본문 바로가기
Delphi, RadStudio

[개발/delphi] how to have an exe file delete itself

by SB리치퍼슨 2011. 12. 12.
[delphi] How to have an EXE file delete itself

http://www.delphifaq.com/faq/delphi_windows_API/f530_0.htm

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.
Content-type: text/html

반응형

댓글