delphi hiding files

Posted on 2006-05-04
Last Modified: 2008-03-03
I have read

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

only renames the file:

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

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

AM I doing soemthing wrong ?

Question by:yarek
    LVL 5

    Accepted Solution

    Try putting that file into a FOLDER then doing the same thing to that folder...

    Peace Scay7

    Author Comment

    Sorry, I did not get your answer... do you have code source ?
    LVL 10

    Expert Comment

    Your code isn't ment for a file, it's ment for a folder
    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..
    LVL 5

    Expert Comment

    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);
    MoveFile('NOTHIDDEN', 'HIDDEN' + '.{645FF040-5081-101B-9F08-00AA002F954E}')

    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

    Expert Comment

    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 :)
    LVL 11

    Expert Comment

    by:Mihai Stancescu
    You can try with
    SetFileAttributtes(filename, faHidden);
    after you move/copy the file;


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now