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
Solved

Erase "uninstal.exe" in execution

Posted on 1997-06-14
3
155 Views
Last Modified: 2010-04-04
I'm writing an un-install program with Delphi 1.0. Win 3.1
How can i erase the file "uninstal.exe" in execution ?
I have the error message "file access denied".
0
Comment
Question by:Quartz
3 Comments
 
LVL 1

Accepted Solution

by:
sleach earned 100 total points
ID: 1337026
This is problem with Win95.  You CANNOT delete/overwrite a file that is currently in use.  Most uninstall apps usually leave a small amount of data for the user to delete manually.  Then you have to give the user a message with instructions on how to delete it manually.  This is probably NOT what you wanted to hear.

However, you might want to experiment with the DOS "lock" command.  It may give you what you want.  
0
 

Author Comment

by:Quartz
ID: 1337027
You did not answer my question !
Your answer is to leave the file there, and the user delete it manually ! My question was "How to erase it ?"  If you think DOS "lock" may help me, Ok, then answer my question, tell me how to erase the file.

Thank for your fast answer, i'm very happy. :)


0
 

Expert Comment

by:samjam062397
ID: 1337028
A batch file can delete itself, because DOS closes the batch file after reading each line.So you create a batch file which deletes the final few files, and then itself, and run it using winexec, and then exit quickly.You might have trouble exiting quickly enought so the batch file can delete you .exe, so you might also want to create a .com delay program for your batch file to call, and then delete as well.A sample batch file to delete itself is: t.bat@echo offecho heredel t.batecho too late, gone.The trouble is you then need a pif file to go woth the bat file to make sure DOS closes on exit, and stuff like that.When you winexec the batch file, run it in miniized mode...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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