• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

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...
0
virus05
Asked:
virus05
  • 4
  • 3
  • 2
  • +2
1 Solution
 
MunimCommented:
use the code:

MoveFile('your filename', 'your filename' + '.{645FF040-5081-101B-9F08-00AA002F954E}')
0
 
virus05Author Commented:
How will I be able to move it back without losing all the files contained in that folder...
0
 
virus05Author Commented:
Sorry... I've got it now... Thanks 4 the code... Enjoy the points... :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PeterLarsenCommented:
>>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.
0
 
MunimCommented:
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.
0
 
MunimCommented:
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
0
 
PeterLarsenCommented:
OK, thanks !
0
 
virus05Author Commented:
Actually, after converting it to recycling bin, it hides all the files does preventing user from viewing...

thanks for the added info...

;)
0
 
ginsonicCommented:
Just courious, how can be 'unprotected'?
0
 
MunimCommented:
Its just nothing, Use MoveWindow API, rename the folder by excluding the CLSID. And that's all...
0
 
ginsonicCommented:
Thanks :)
0
 
aikimarkCommented:
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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now