[2008] Search Problem on VISTA
Hey there,
I was working on a project that was requiring a "file search" operation...
so i used the following code...
Code:
Dim vbforums As New IO.DirectoryInfo(FileIO.SpecialDirectories.Desktop)
For Each dir As IO.DirectoryInfo In vbforums.GetDirectories
If Not ((dir.Attributes And IO.FileAttributes.System) = IO.FileAttributes.System) Then
ListBox1.Items.AddRange(IO.Directory.GetFiles(dir.FullName, "*.txt", IO.SearchOption.AllDirectories))
End If
Next
Well, i was running the whole program on my winXP box but
unfortunatelly when i finished the project (22 days later)
and tried it on Vista it simply didnt work :sick::ehh:
So do i have to change something?
I dont even want to think that i have to use Dir1 and File1 lol
Re: [2008] Search Problem on VISTA
You might need to be running with security privileges to be able to access those directories. Remember, Vista likes to do everything on a user-level. Other than that, it should work fine.
Other than that, only thing I can think of is the FileAttributes thing. Does Vista even have System attributes any more? I know they implemented a major file-meta data scheme (where any file can store meta-data) and was wondering if that information was moved to there. How you'd access it though, I wouldn't know.
Re: [2008] Search Problem on VISTA
i am running as root...
and lol i dont know about these "meta-data"
Re: [2008] Search Problem on VISTA
I don't work with Vista on a day-to-day basis, so I don't know the details, but what I remember hearing at it's launch, one of the hot "new features" was that any file could be tagged with meta-data. thus, you could for example tag picture files with location of shot, people who are in it, date taken, comments, etc; and all this is done natively by the OS.
How, I don't know since the physical filesystem is still NTFS. The idea is when you used the new Windows Search, it would search this meta data as well. So, searching for "San Francisco" would bring up documents with the term in them, pictures that were taken there (even if the filename of the jpg was something like "DF00231.jpg") and what-not.
I'm wondering if they moved information like the System File attribute there as well. Perhaps someone more familiar with Vista would know.
Have you tried removing the If() statement from your code and trying it on the Vista box?
Re: [2008] Search Problem on VISTA
oh now i got what u said, well... stupid feature, definatelly not hot lol...
and yes i removed the "if" case and run it on my vmware~vista with no results...
thanks for the answer though, i guess it took u a while to explain me all these things lol :thumb:
Re: [2008] Search Problem on VISTA
hi I was looking for the same thing...
I have seen several links around... but noone has the solution
btw dis forum seems cool, and thnx to ur request and google now I am member of it hehe
I hope to take our answer after all
greetz
~stargazer
Re: [2008] Search Problem on VISTA
Even when you are logged into Vista as Admin its not a true administrator. Plus you need to specify in a manifest file to elevate your process to run under administrator credientials otherwise it may come across File Virtualization issues where a file appears to be in a location but its really just a shortcut to the uses appdata folder etc.
Re: [2008] Search Problem on VISTA
so what do u propose robdog?
vista's search engine is working without administration so
there must be a way to do it with programming right?
isnt that logical?
Re: [2008] Search Problem on VISTA
Vistas search engine is not a 3rd party program though. Use a manifest file and elevate your entire app (not really a good security measure) or write another process that gets invoked by your app with elevation so only a small part of your program runs asa administrator.
Re: [2008] Search Problem on VISTA
hmm and how can i do what u describe?
can u give me some links or something to look into?
or maybe an example if u dont mind!!!! :)
Re: [2008] Search Problem on VISTA
yes any link would be useful or at least another way to
search... otherwise i guess i have to use Dir1 and ListBox1
which will make my project pages longer...
thanks for the answers anyway