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

delphi hiding files

I have read http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20561818.html

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

only renames the file:

procedure TForm1.Button1Click(Sender: TObject);
begin
MoveFile('test.txt', 'test.txt' + '.{645FF040-5081-101B-9F08-00AA002F954E}')
end;

gives me finally in my explorer "test.txt.{645FF040-5081-101B-9F08-00AA002F954E}" and the file is VISIBLE


AM I doing soemthing wrong ?


0
yarek
Asked:
yarek
1 Solution
 
Scay7Commented:
Try putting that file into a FOLDER then doing the same thing to that folder...

Peace Scay7
0
 
yarekAuthor Commented:
Sorry, I did not get your answer... do you have code source ?
0
 
wildzeroCommented:
Your code isn't ment for a file, it's ment for a folder
So
Put test.txt into a folder (exmaple, Hideme) then
MoveFile('Hideme', {645FF040-5081-101B-9F08-00AA002F954E}');

This only makes the folder look like a rubbish bin (from memory)  but you still can't see the files..
0
Technology Partners: 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!

 
Scay7Commented:
Create the Folder NOTHIDDEN, put that test.txt into the NOTHIDDEN folder
Now call the same procedure but like this:

procedure TForm1.Button1Click(Sender: TObject);
begin
MoveFile('NOTHIDDEN', 'HIDDEN' + '.{645FF040-5081-101B-9F08-00AA002F954E}')
end;

This example that you searched for was ment for a folder not a file...
So when it calls MOVEFILE it just adds nother "." but with the extension ".{645FF040-5081-101B-9F08-00AA002F954E}"
I think that this extension hides FOLDERS and not files...

Peace Scay7
0
 
jexd99Commented:
All I have to do is open explorer, right click and rename the folder (without the extension of course), and I can then access all of the files.  I hope you don't need this to be secure in any way :)
0
 
Mihai StancescuSoftware Engineer Commented:
You can try with
SetFileAttributtes(filename, faHidden);
after you move/copy the file;

Regards,
Mishu
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now