Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

zhang_zhou

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

This topic is 6596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!:-)

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!