Solved

Deleting application' exe

Posted on 2000-03-05
1
150 Views
Last Modified: 2010-04-04
Hi!

I have an application which is a kind of setup application (it copies some files). When the setup is finished, is it possible to delete that file? I tried to call a delete function in the application, but of course the file couldn't be deleted because Windows were using it. Any suggestions?

Thanx
0
Comment
Question by:eruj
1 Comment
 
LVL 7

Accepted Solution

by:
ahalya earned 40 total points
ID: 2584544
The ONLY guaranteed way to do that would be to use a DOS batch file.  The best windows method, AFAIK, will leave a file in the "Temp" directory.

The following DOS File works.

Create a batch file on your form's onDestry event and Execute it as the last step  in your EXE.

The BAT will consist of the following:[literally speaking :-)]

:repeat
del "Your.EXE" > nul
if exists "Your.EXE" goto repeat
del "BATNamee.bat"<ctrl-z>

Remember the <CTRL-Z> after batname to avoid the "file missing" error.
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

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 169
automatically logging in via bde delphi 3 68
calling procedure inside activexForm from secondform 1 231
Delphi cmd execution 6 55
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…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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