Link to home
Start Free TrialLog in
Avatar of virus05
virus05

asked on

Protect a folder...

Experts,

   Could someone show me a code in Delphi 6 on how to protect a user from reading the contents of a certain folder... Please show me a code... The simplier the better...

Thanks in advance...
ASKER CERTIFIED SOLUTION
Avatar of Munim
Munim

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of virus05
virus05

ASKER

How will I be able to move it back without losing all the files contained in that folder...
Avatar of virus05

ASKER

Sorry... I've got it now... Thanks 4 the code... Enjoy the points... :)
>>MoveFile('your filename', 'your filename' + '.{645FF040-5081-101B-9F08-00AA002F954E}').
Hi Munin,
How does this work and is it documented somewhere ?
I have searched google for the guid no and found a lot about the Recycle Bin, but not anything about file protection.
There isn't any documentations, but the fact is, it is the CLSID of the recycle bin. Windows, marks as the folder as recycle bin when it gets the extension as the CLSID. And that's all.
Here are some other CLSID that can convert to any shape...

Control_P = '.{21EC2020-3AEA-1069-A2DD-08002B30309D}'
My_COMP = '.{20D04FE0-3AEA-1069-A2D8-08002B30309D}'
Desk_TOP = '.{9E56BE61-C50F-11CF-9A2C-00A0C90A90CE}'
NetWork = '.{208D2C60-3AEA-1069-A2D7-08002B30309D}'
IE = '.{FBF23B42-E3F0-101B-8488-00AA003E56F8}'
RBin = '.{645FF040-5081-101B-9F08-00AA002F954E}'
Printer = '.{2227A280-3AEA-1069-A2DE-08002B30309D}'
HTMLDoc = '.{25336920-03F9-11CF-8FD0-00AA00686F13}'
TaskS = '.{255b3f60-829e-11cf-8d8b-00aa0060f5bf}'
WaveFile = '.{0003000D-0000-0000-C000-000000000046}'
MovClip = '.{00022602-0000-0000-C000-000000000046}'
WinIcon = '.{00021401-0000-0000-C000-000000000046}'


Thank You
Munim
2Munim@MyRealBox.com
OK, thanks !
Avatar of virus05

ASKER

Actually, after converting it to recycling bin, it hides all the files does preventing user from viewing...

thanks for the added info...

;)
Just courious, how can be 'unprotected'?
Its just nothing, Use MoveWindow API, rename the folder by excluding the CLSID. And that's all...
Thanks :)
Avatar of aikimark
post-closure comment:

Please be aware that the accepted solution does not actually 'hide' a folder or the files within it.
* the folder and its files are visible from a command prompt
* the folder and its files are visible from program calls, without first having to unhide the folder
* RootkitRevealer found it and reported four lines on the folder and the one file it contained (on my test)

In my opinion, this method is less 'hidden' than using the APIs to insert an ASCII 0 character (and other stuff) into a folder's name or Registry Key name in order to prevent Windows from displaying its contents.

===================================
The bottom line is this...
Your intellectual property is at risk unless you use strong encryption methods.