Results 1 to 3 of 3

Thread: Change folder view to show-hidden-files [RESOLVED-one last question]

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    4

    Resolved 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.
    Last edited by shmickz; Apr 26th, 2005 at 11:53 PM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    4

    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:
    1. Private Function GetFiles(ByVal oFolder As String) As ArrayList
    2.  
    3.         Dim FileName As String
    4.         Dim arrFiles As New ArrayList
    5.         For Each FileName In Directory.GetFiles(oFolder)
    6.             Dim FInfo As New FileInfo(FileName)
    7.             arrFiles.Add(FInfo.FullName)
    8.         Next
    9.  
    10.         Return arrFiles
    11.  
    12.     End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width