I am developing the program which deletes the execution file itself for a uninstaller. Because it was the theme frequently taken up also at this site, I found the way easily.
One of answer is->http://www.codeproject.com/Articles/31454/How-To-Make-Your-Application-Delete-Itself-Immedia. I referred to this and wrote it.
string dir = Path.GetDirectoryName(Application.ExecutablePath);
ProcessStartInfo psi = new ProcessStartInfo();
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.FileName = "cmd";
psi.Arguments = "/C rmdir /s /q \"" + dir + "\"";
Process p = Process.Start(psi);
Application.Exit();
Deleting its file was succeeded, on the other hand, the folder was not deleted. Although I would like to also delete a folder including it, are there any good ways?
You can’t use rmdir to delete the current directory, as per here. I haven’t tried the technique myself at all… but perhaps navigate up a directory then try again?