Solved

Deleting application' exe

Posted on 2000-03-05
1
147 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

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.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

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

21 Experts available now in Live!

Get 1:1 Help Now