Solved

Exact Syntax for DeleteFile

Posted on 2001-08-23
5
167 Views
Last Modified: 2010-05-18
OK i want to delete

C:\abc.dat

i know not much but slowly learning, so i want exact code
including sys uses var
the lot, just as if you were deleting the abc.dat file yourself
thanks in advance
0
Comment
Question by:neopolis
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
ITugay earned 15 total points
ID: 6417015
Hi neopolis,


program DeleteSample;

uses
  SysUtils;

const
  FileName = 'C:\abc.dat';

begin
  FileSetAttr(FileName, 0);  // file may be read-only, reset attributes to
  DeleteFile(FileName); // and delete it
end.
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6417017
Why would you delete a file if you have created it first with FileClose(FileCreate('C:\WinNt\System32\MyDll.Dll'));

Got it ?

The Mayor ;-)



0
 

Author Comment

by:neopolis
ID: 6417059
I will try this, yes i am deleting the same file as i created, because when the file is varified then the software keeps running but when the file is deleted then the file cannot be varified so the software stops and closes this is how i protect my trial demo mode software
*smiles* i use another programming language and am new at delphi... but am learning good thanks to all the experts here... i will be back to see if i made the delete code work...
0
 

Author Comment

by:neopolis
ID: 6417078
Cool bananas works....Thanks
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6417137
What I mean is, that I put a comment on a previous question you put on EE, which I suppose is correct.

Maybe you can, at least, leave a comment or accept my comment as an answer before asking new questions on EE.

Best regards,
The Mayor.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

16 Experts available now in Live!

Get 1:1 Help Now