Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How mark file to delete after restaring?

Status
Not open for further replies.

ZakiMaksyutov

Programmer
Feb 28, 2001
87
RU
I wrote one .exe file, which "uninstaller". It removes all, but also it should remove itself. To my mind I can "mark" this file and after restarting Windows deletes it, but I don't know how :(
May be someone know? Some exmples will be very great.

Thank for any help.
 
under win95 there is a file called WININT.INI and under a line called [remove] you simply add the program to be removed at startup... Well thats the theory as I've been trying to do it for ages and no luck..

Also you can use the

CopyFile() command and use a NULL destination with a extension to let windows know to copy the file on a reboot.

This one to seems to run fine for me but wont delete the file :(


If you have any tips on deleting files in general can you let me know too :)
 
If you want to install a software,why don't try to use InstallSheld???It do help you!!!
 
Read the article "Q&A Win32 Periodicals 1996" from MSDN. It makes a discution on how to delete a file after reboot on both the Win9x and WinNT platforms.

Also in it, there is some code which should work on both platforms. (in WinNT it uses the MoveFileEx API and in Win9x it uses the [Rename] section of WININIT.INI file)

HTH, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top