Solved

Exact Syntax for DeleteFile

Posted on 2001-08-23
5
168 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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