[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
Re: How to hide a folder in XP
im not sure..
maybe like this?
Code:
SetAttr "C:\FolderName", vbHidden
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_?
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?"
Re: How to hide a folder in XP
How does the professional programs do it? IE Lock Folder XP 3.7?
thanks
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.
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.
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.
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.
Re: How to hide a folder in XP
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.
Re: How to hide a folder in XP
Quote:
Originally Posted by
RobDog888
"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.
Re: How to hide a folder in XP
Quote:
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.