Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. string vBatFile = Path.GetDirectoryName(Application.ExecutablePath) + "\uninst.bat";
  2. using (StreamWriter vStreamWriter = new StreamWriter(vBatFile, false, Encoding.Default))
  3. {
  4. vStreamWriter.Write(string.Format(
  5. ":delrn" +
  6. "del "{0}"rn" +
  7. "if exist "{0}" goto delrn" +
  8. "timeout 10rn" + // timeout added for test. even with this it won't work
  9. "rmdir "{1}" /s/qrn",
  10. Application.ExecutablePath, Application.StartupPath));
  11. }
  12. //vStreamWriter.Write(string.Format("rmdir "{0}" /s/q", Application.StartupPath));
  13. WinExec(vBatFile, 0);
  14. Application.Exit();
  15.  
  16. vStreamWriter.Write(string.Format("rmdir "{0}" /s/q", Application.StartupPath));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement