yarek
asked on
delphi hiding files
I have read https://www.experts-exchange.com/questions/20561818/Protect-a-folder.html
However MoveFile('your filename', 'your filename' + '.{645FF040-5081-101B-9F08 -00AA002F9 54E}')
only renames the file:
procedure TForm1.Button1Click(Sender : TObject);
begin
MoveFile('test.txt', 'test.txt' + '.{645FF040-5081-101B-9F08 -00AA002F9 54E}')
end;
gives me finally in my explorer "test.txt.{645FF040-5081-1 01B-9F08-0 0AA002F954 E}" and the file is VISIBLE
AM I doing soemthing wrong ?
However MoveFile('your filename', 'your filename' + '.{645FF040-5081-101B-9F08
only renames the file:
procedure TForm1.Button1Click(Sender
begin
MoveFile('test.txt', 'test.txt' + '.{645FF040-5081-101B-9F08
end;
gives me finally in my explorer "test.txt.{645FF040-5081-1
AM I doing soemthing wrong ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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-0 0AA002F954 E}');
This only makes the folder look like a rubbish bin (from memory) but you still can't see the files..
So
Put test.txt into a folder (exmaple, Hideme) then
MoveFile('Hideme', {645FF040-5081-101B-9F08-0
This only makes the folder look like a rubbish bin (from memory) but you still can't see the files..
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 -00AA002F9 54E}')
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 -00AA002F9 54E}"
I think that this extension hides FOLDERS and not files...
Peace Scay7
Now call the same procedure but like this:
procedure TForm1.Button1Click(Sender
begin
MoveFile('NOTHIDDEN', 'HIDDEN' + '.{645FF040-5081-101B-9F08
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
I think that this extension hides FOLDERS and not files...
Peace Scay7
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 :)
You can try with
SetFileAttributtes(filenam e, faHidden);
after you move/copy the file;
Regards,
Mishu
SetFileAttributtes(filenam
after you move/copy the file;
Regards,
Mishu
ASKER