[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Erase "uninstal.exe" in execution

Posted on 1997-06-14
3
Medium Priority
?
163 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 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