Advertisement

How can I delete one .EXE file while it is running?

Started by November 27, 2000 04:04 AM
1 comment, last by zhang_zhou 24 years, 1 month ago
Hi,everybody,now I have a problem,can you help me?---that is,I want to write a uninstall programme,but as you known,one .EXE programme cannot delete itself,so I cannot clear the uninstall.exe after the other files have been deleted,later,I have a way,that is,place a line such as "delete c:\programme files\app\uninstall.exe" to the system registry''s entry--HLM\Software\Microsoft\Windows\CurrentVersion\RunOnce,then the file will be deleted on the next startup,but it is not-so well,since the file must be deleted after reboot...so who have the other way to solve the problem that it will delete the file at once and don''t have to reboot? please tell me,ok? thanks!:-)
============================= Hey,I just wanna know WHY! =============================
you could make your uninstall program move itself to somewhere like C:\windows\temp\, or another folder that automatically deletes itself over time... then tell that program to delete the installed program...
just thought you should know, i''v never made an uninstall program, so i dont know if it will work, but its just a thought...

_________
Tsutomegi
Advertisement
Tsu, what you said is even slower and more unreliable than the RunOnce method ! I guess RunOnce is the way to go. Or maybe there''s another way, smilar to how the system does critical registry updates. Have you ever looked at the code of Back Orifice 2K ? It can delet itself... somehow...
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity

This topic is closed to new replies.

Advertisement