Results 1 to 13 of 13

Thread: [RESOLVED] How to hide a folder in XP

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Resolved [RESOLVED] How to hide a folder in XP

    I am wanting to write a security application that will hide specified folders. How can I do this?

    I have seen many examples, many of them just rename the folder and adds an extension like: .{f39a0dc0-9cc8-11d0-a599-00c04fd64433}

    Is there a better way to do this? Someone can just rename the folder removing the extension.

    Maybe a hook.... or is there an easier way?

    thanks

    Canning
    Last edited by Simon Canning; Oct 7th, 2009 at 04:06 AM.

  2. #2
    Hyperactive Member jp26198926's Avatar
    Join Date
    Sep 2008
    Location
    General Santos City, Philippines
    Posts
    310

    Re: How to hide a folder in XP

    im not sure..

    maybe like this?
    Code:
    SetAttr "C:\FolderName", vbHidden
    "More Heads are Better than One"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to hide a folder in XP

    And, there is the API way
    Code:
    Private Declare Function SetFileAttributes Lib "kernel32" Alias "SetFileAttributesA" _
    (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As Long
    Private Const FILE_ATTRIBUTE_ARCHIVE = &H20
    Private Const FILE_ATTRIBUTE_COMPRESSED = &H800
    Private Const FILE_ATTRIBUTE_DIRECTORY = &H10
    Private Const FILE_ATTRIBUTE_HIDDEN = &H2
    Private Const FILE_ATTRIBUTE_NORMAL = &H80
    Private Const FILE_ATTRIBUTE_READONLY = &H1
    Private Const FILE_ATTRIBUTE_SYSTEM = &H4
    Private Const FILE_ATTRIBUTE_TEMPORARY = &H100
    
    
    'After The Question Mark You Can Add Any Of The Following
    'Archive, Compressed, Directory,Hidden,Normal,Read-Only, System, Or Temporary
    
    'File = "What Ever File You Want!"
    File = "c:\temp"
    SetFileAttributes File, FILE_ATTRIBUTE_?

  4. #4
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: How to hide a folder in XP

    Sure you can turn on the hidden attribute but then they can turn on "show hidden files and folders". I don't think people understand that you can't really use a high level language like VB6 to do things like this. Anyway, it's not the job of a programming language to provide security to your files. This is something that is handled with user accounts, rights, and permissions.

    I'm waiting for a question like this:
    "How can I use VB6 to cook my dinner?"
    Last edited by danecook21; Oct 7th, 2009 at 08:16 AM.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Re: How to hide a folder in XP

    How does the professional programs do it? IE Lock Folder XP 3.7?

    thanks

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

    Re: How to hide a folder in XP

    "Locking" a folder from deletion or just access?
    I know I wouldnt want to install a program that locked me out of a folder on my system.

    There is really no real reason to protect a folder programmatically. All folder protection should be done via Windows Security or Group Policy Objects.
    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

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Re: How to hide a folder in XP

    just access. I want to make an app where the user can hide folders that have sensitive data.

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

    Re: How to hide a folder in XP

    If its sensetitive data then you should encrypt it and then no worries about accessing the folder.
    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

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Re: How to hide a folder in XP

    I have already done an encryption app, i am wanting to make a hide folder app.
    If i just encrypt it,they can see that there is a folder that has been encrypted, if it is hidden then they have no idea.

  10. #10
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: How to hide a folder in XP


  11. #11
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: How to hide a folder in XP

    Didn't you ask this same question one year ago?

    http://www.vbforums.com/showthread.php?t=537993

    The professional applications install a driver, something you can't write with VB6.

  12. #12
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: How to hide a folder in XP

    Quote Originally Posted by RobDog888 View Post
    "Locking" a folder from deletion or just access?
    I know I wouldnt want to install a program that locked me out of a folder on my system.

    There is really no real reason to protect a folder programmatically. All folder protection should be done via Windows Security or Group Policy Objects.
    +1. I would recommend hiding sensitive files on a folder but not hiding the folder. Note that if you copy a backup file to a missing file that was originally hidden, you have to set the attribute to vbHidden after the file is restored, even if the backup file is also hidden.
    Doctor Ed

  13. #13
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: How to hide a folder in XP

    I am wanting to write a security application that will hide specified folders.
    This is a bad idea. Stealthing a folder and it's contents can be exploited by malware. Remember the Sony DRM rootkit (and the class action lawsuits that went along with it)? Remember how it was exploited? You're asking how to do the exact same thing.

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