![]() |
|
#1
|
|||
|
|||
|
Hi :
How can I hide a folder from the explorer window, or any browser ...(I see a software that can do this thing) thank in advance, Osama ... |
|
#2
|
|||
|
|||
|
Yes, you see a software which do that. But this software isn't written in Delphi. To hide a folder, you need to make a VxD file, and that is done in C++, with help of Microsoft DDK. Believe me, there's no way actually to do that in Delphi. You can write the VxD interface, but not the VxD itself.
|
|
#3
|
|||
|
|||
|
Function HideDirectory(Const TheFile : String): Boolean;
Var Attrib : Integer; Begin Result := False; Try If Not FileExists(TheFile) Then Exit; Attributes := faDirectory + faHidden + faSysFile; FileSetAttr(TheFile,Attributes); Result := True; Except End; End; Function UnHideDirectory(Const TheFile : String): Boolean; Var Attrib : Integer; Begin Result := False; Try If Not FileExists(TheFile) Then Exit; Attributes := faDirectory ; FileSetAttr(TheFile,Attributes); Result := True; Except End; End; The first function hides the directory by setting the attributes to hidden/system. the second function unhides the directory by setting the attributes to just a directory. Be warned though: If the windows explorer has the options set to view ALL files, this will NOT WORK! |
|
#4
|
|||
|
|||
|
I have done such an application. And I have commercial apps which do it. But none of them can really totally hide a folder. Mine can't, too. There's always a way to see if there's an hidden directory somewhere
|
|
#5
|
|||
|
|||
|
I think that some "virus" exists (exe file - not vxd driver) that installs yourself in HKEY_CLASSES_ROOT\file\shell\open\command (or something like this) in registry, then "catch" file calls, then starts program or open file. If you delete virus exe file, you will be unable to open any file. Is that can be used in this case? By default, file calls "catch" rundll32.exe.
|
|
#6
|
|||
|
|||
|
I forgot to explain. For example, start regedit, go to HKEY_CLASSES_ROOT\exefile\shell\open\command key, then change default value from "%1" %* to blahblahblah - you will be unable to start any exe file. After you try, please back default value - "%1" %*
Also, default values for folder are: HKEY_CLASSES_ROOT\Folder\shell\explore\command Default value is C:\WINDOWS\Explorer.exe /e,/idlist,%I,%L HKEY_CLASSES_ROOT\Folder\shell\open\command Default value is C:\WINDOWS\Explorer.exe /idlist,%I,%L You can try to wrote application that by command line parameters compares requested folder from explorer with "protected" folders (included all subfolders) list, then if requested folder not in the list, calls explorer with command parameters above. Application shall to replace default values above. That's just my idea, of course. Remember, modifying the registry can cause serious problems that may require you to reinstall your operating system. I cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk. If you decide to try this, please use another machine for testing, or install two OS at your machine for restoring registry from backup from one OS to another, if something goes wrong. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|