Created
June 24, 2015 12:30
-
-
Save erkantaylan/c0a74e1789bd8902a1e2 to your computer and use it in GitHub Desktop.
C#, self destroy, kendini silen exe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void SelfDestroy() | |
{ | |
string currentPath = Environment.CurrentDirectory; | |
string programName = Process.GetCurrentProcess().ProcessName; | |
string path = string.Format(@"{0}\{1}", currentPath, programName); | |
Process.Start(new ProcessStartInfo() | |
{ | |
Arguments = string.Format("/C choice /C Y /N /D Y /T 3 & Del \"{0}\"", path), | |
WindowStyle = ProcessWindowStyle.Hidden, | |
CreateNoWindow = true, | |
FileName = "cmd.exe" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment