How to completely Hide a folder C++ without using attrib command Windows ???

closed account (3hMz8vqX)
Hi all,
Im making a small program to hide some folders
Now on the net I found many ways to hide a folder and the most best thing I found
was the attrib command, which is very powerful. . .

So, now I want to hide a folder like the attrib command does

The user should not see the folder even when Show hidden files / folders is enabled. . .

Can you please help me by giving a code snippet ???

If you can do this by using some API I will be happy. . .

Thankyou everyone in advance!
Good question, if only there were a WinAPI function to SetFileAttributes(): http://msdn.microsoft.com/en-us/library/windows/desktop/aa365535(v=vs.85).aspx

:P
Hi,

There are several options available at the moment, one is using the SetFileAttributes() as Computergeek01 stated.

Doing a PE\Code injection into "explorer.exe" (native Windows Process) then removing it from the list.

Or injecting then hooking ZwQueryDirectoryFile() (Lower level function than NtQueryDirectoryFile() because the KiSystemFastCall intercepts it in Ring3).

Next using ACL\DACLS edit the folder attributes to become hidden then edit the following registry key in order to hide\deny access to your folder:

HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFolderOptions dword:00000001
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Advanced\Hidden dword:00000002


Personally the 1st one can easily be fixed either through few Tricks therefore the 2nd and 3rd options are the best.

GL

Topic archived. No new replies allowed.