如何在C中删除exe [英] How to delete the exe in c
本文介绍了如何在C中删除exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hai,
我正在创建一个exe以便执行...操作完成后,该exe要自动删除.
如何做到这一点. (自动删除该exe,而无需创建另一个exe)
谢谢.
hai,
i am creating one exe for opeartion ...Once the Operation done the exe want to delete automatically .
How to do that one. (Automatically want to delete that exe with out creating another exe)
Thanks.
推荐答案
自删除可执行文件 [ ^ ]
编写自毁exe文件 [
Self Deleting Executables[^]
Writing a self destructing exe file[^]
不清楚情况是什么,一个是EXE,另一个是EXE…您需要了解一件事:无法删除当前正在运行的进程加载的任何可执行文件. EXE,DLL没关系.
—SA
Not clear what is the scenario, what is one EXE, another EXE… You need to know one thing: it is not possible to delete any executable file loaded by a currently running process. EXE, DLL, does not matter.
—SA
在非常简单的步骤中,在程序结束时,您需要运行一个批处理文件(在Windows中),然后删除exe.
一种复杂性是您要删除的文件可能仍在使用中.因此请在批处理文件中添加适当的延迟,以使exe可以删除.
In very simple steps, towards the end of your program you need to run a batch file (in windows) the deletes the exe.
One complexity is that the file you are deleting might still be in use. so add a suitable delay in the batch file for the exe to be deletable.
这篇关于如何在C中删除exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文