Solved

Deleting application' exe

Posted on 2000-03-05
1
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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
find a node in VST 2 92
Slow Restore if incremental backups using RDiff.exe 4 51
Delphi Seattle StructureView color 1 34
Connect to SQL 2008 r2 server over the Internet 4 80
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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