is there any way to add code to delete self, like, you will run program, it will do something and then delete his .exe? I don't know how to do it cuz it gives me error because that program is running, this is what I have:
well, I wanna delete program that will execute command to delete, so I will run testlol.exe, it will copy self to another folder and then delete self from first folder, remove function don't works too...
yes I wanna move it, not rename...
look, I have program in
D:\ called testlol.exe,
so I have D:\testlol.exe
this program will copy self to D:\test\ so I will have D:\test\testlol.exe AND D:\testlol.exe
------ until now it works fine
BUT now I wanna delete that testlol from D:\, so I will have:
D:\test\testlol.exe ONLY ... NO MORE D:\testlol.exe
and I need to do that by just running that testlol.exe in D:\, nothing else
Impossible, windows keeps the file stream open for a program, so it can't delete itself. You should run the copy and pass it your current path and then exit, allowing the copy to delete the original.