?
Solved

Protect a folder...

Posted on 2003-03-24
12
Medium Priority
?
479 Views
Last Modified: 2010-04-03
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
Comment
Question by:virus05
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 1

Accepted Solution

by:
Munim earned 1060 total points
ID: 8205192
use the code:

MoveFile('your filename', 'your filename' + '.{645FF040-5081-101B-9F08-00AA002F954E}')
0
 

Author Comment

by:virus05
ID: 8207453
How will I be able to move it back without losing all the files contained in that folder...
0
 

Author Comment

by:virus05
ID: 8207476
Sorry... I've got it now... Thanks 4 the code... Enjoy the points... :)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Expert Comment

by:PeterLarsen
ID: 8208949
>>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
 
LVL 1

Expert Comment

by:Munim
ID: 8212019
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
 
LVL 1

Expert Comment

by:Munim
ID: 8212045
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
 
LVL 2

Expert Comment

by:PeterLarsen
ID: 8216247
OK, thanks !
0
 

Author Comment

by:virus05
ID: 8222464
Actually, after converting it to recycling bin, it hides all the files does preventing user from viewing...

thanks for the added info...

;)
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 8222854
Just courious, how can be 'unprotected'?
0
 
LVL 1

Expert Comment

by:Munim
ID: 8231469
Its just nothing, Use MoveWindow API, rename the folder by excluding the CLSID. And that's all...
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 8233399
Thanks :)
0
 
LVL 46

Expert Comment

by:aikimark
ID: 16219677
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question