Solved

Deleting application' exe

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 161
Internet Explorer View Settings Question 15 117
How to debug For loops? 3 57
DBGrid or StringGrid ? 6 105
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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