How Can A Exe File Kill himself? a common trick to make a program self-destruct is to have it write a tiny batch file, and, as the very last thing it does before closing, starting this batch file with a winexec(batchfilename, SW_HIDE ); The batch deletes the program and then can delete itself. The last line is adel %0and it is *not* terminated with a carriage return/line feed pair.
我这有两种办法,其中一种上边已有提到,在点击删除按钮后,建立一个临时批处理如temp.bat del youPrg del temp.bat 程序调用批处理 立即关闭程序 而另一种更简单 application.Terminate; winexec(pchar('command.com /c del '+application.exename),SW_SHOWMINNOACTIVE); //注意在winnt/2k下应考虑用 cmd 或 command 上来看看 http://rbsky.myetang.com
a common trick to make a program self-destruct is to have it write a tiny
batch file, and, as the very last thing it does before closing, starting
this batch file with a
winexec(batchfilename, SW_HIDE );
The batch deletes the program and then can delete itself. The last line is adel %0and it is *not* terminated with a carriage return/line feed pair.
del youPrg
del temp.bat
程序调用批处理
立即关闭程序
而另一种更简单
application.Terminate;
winexec(pchar('command.com /c del '+application.exename),SW_SHOWMINNOACTIVE);
//注意在winnt/2k下应考虑用 cmd 或 command
上来看看 http://rbsky.myetang.com
用批处理文件,
先删EXE后删BAT
批处理文件的内容为删除该程序,删除批处理自身
2。先用dll进程将一个dll映射进资源管理器进程
结束自身,这时第二个dll不会被结束。可以删除该程序