DelphiFAQ Home Search:

How to have an EXE file delete itself

 

comments1 comments. Current rating: 3 stars (1 votes). Leave comments and/ or rate it.

Both Windows 95 and NT provide mechanisms for doing just this.

Under Win95 you use the WinInit.ini file. Create a [rename] section and
put in entries like "NewName.txt=OldName.txt" to have files renamed, or
"nil=OldName.txt" to have them deleted. Windows will perform this at
the next boot.

Under Windows NT, the MoveFileEx function has a parameter that allows
you to defer the move (or delete) until the next boot. It stores the
list of files to be processed in the registry.

Comments:

2007-01-24, 20:14:27
anonymous from Vietnam  
rating

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: