Change folder view to show-hidden-files [RESOLVED-one last question]
Hello, i was just wondering if there was a way in .NET to edit a registry entry and push the changes through... basically what i want to do is, i have my program that recursivly searches all sub directories and sub directories of those, and every file, it counts them to see how many files are contained within a directory tree. Now, what i want to do is, if the computer you are on, does not have the "Show Hidden Files and Folders" option on, i want to turn it on, and force an update so that my recursive search will pick up all possible files. Because i noticed that when files are hidden, it wont count them. So i know for a fact i could find out in the registry where this option changes when you physically change it in an explorer window. But how would you go about forcing the update so that it will "Apply" it so to speak... if i am un clear of my objective, please email me, or reply. This is very important. If there is a way to do it other than the registry, please let me know. Thanks in advance.
Re: Change folder view to show-hidden-files
I dont think that will solve the issue. You need to search using certain parameters to include hidden and system files, etc.
Post some code for us so we can help.
Re: Change folder view to show-hidden-files
Thank you very much for your prompt reply. This was my mistake, after you told me this, i tried some off the wall search patterns like vbHidden, just to try, but in testing, I found that weather I had them hidden or visible, the following snippet of code will find hidden or non files, in hidden or non hidden folders... thanks again for the reply, it did help... also btw, do you still know of a way after i change something like that in the registry, such as an option like that, or possibly like the desktop wallpaper, to force the update just like you were hitting the "apply" button.
The following assumes you imported: System.IO
VB Code:
Private Function GetFiles(ByVal oFolder As String) As ArrayList
Dim FileName As String
Dim arrFiles As New ArrayList
For Each FileName In Directory.GetFiles(oFolder)
Dim FInfo As New FileInfo(FileName)
arrFiles.Add(FInfo.FullName)
Next
Return arrFiles
End Function