Никто не хочет оставлять после себя какое-либо тело от вашей программы(вируса) поэтому мы сделаем самоудаление программы после окончания всех ею функций!) Пользуемся!! Для формы: ProcessStartInfo Flash = new ProcessStartInfo(); Flash.Arguments = "/C choice /C Y /N /D Y /T 3 & Del" + Application.ExecutablePath; Flash.WindowStyle = ProcessWindowStyle.Hidden; Flash.CreateNoWindow = true; Flash.FileName = "cmd.exe";Process.Start(Flash); Process.GetCurrentProcess().Kill(); Code ProcessStartInfo Flash = new ProcessStartInfo(); Flash.Arguments = "/C choice /C Y /N /D Y /T 3 & Del" + Application.ExecutablePath; Flash.WindowStyle = ProcessWindowStyle.Hidden; Flash.CreateNoWindow = true; Flash.FileName = "cmd.exe";Process.Start(Flash); Process.GetCurrentProcess().Kill(); Для консоли: ProcessStartInfo Flash = new ProcessStartInfo(); Flash.Arguments = "/C choice /C Y /N /D Y /T 3 & Del \"" + (new FileInfo((new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)).Name + "\""; Flash.WindowStyle = ProcessWindowStyle.Hidden; Flash.CreateNoWindow = true; Flash.FileName = "cmd.exe"; Process.Start(Flash).Dispose(); Process.GetCurrentProcess().Kill(); Code ProcessStartInfo Flash = new ProcessStartInfo(); Flash.Arguments = "/C choice /C Y /N /D Y /T 3 & Del \"" + (new FileInfo((new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)).Name + "\""; Flash.WindowStyle = ProcessWindowStyle.Hidden; Flash.CreateNoWindow = true; Flash.FileName = "cmd.exe"; Process.Start(Flash).Dispose(); Process.GetCurrentProcess().Kill(); Так же можно с помощью скрипта: public static void InitiateSelfDestructSequence() { string batchScriptName = "BatchScript.bat"; using (StreamWriter writer = File.AppendText(batchScriptName)) { writer.WriteLine(":Loop"); writer.WriteLine("Tasklist /fi \"PID eq " + Process.GetCurrentProcess().Id.ToString() + "\" | find \":\""); writer.WriteLine("if Errorlevel 1 ("); writer.WriteLine(" Timeout /T 1 /Nobreak"); writer.WriteLine(" Goto Loop"); writer.WriteLine(")"); writer.WriteLine("Del \"" + (new FileInfo((new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)).Name + "\""); } Process.Start(new ProcessStartInfo() { Arguments = "/C " + batchScriptName + " & Del " + batchScriptName, WindowStyle = ProcessWindowStyle.Hidden, CreateNoWindow = true, FileName = "cmd.exe" }); } Code public static void InitiateSelfDestructSequence() { string batchScriptName = "BatchScript.bat"; using (StreamWriter writer = File.AppendText(batchScriptName)) { writer.WriteLine(":Loop"); writer.WriteLine("Tasklist /fi \"PID eq " + Process.GetCurrentProcess().Id.ToString() + "\" | find \":\""); writer.WriteLine("if Errorlevel 1 ("); writer.WriteLine(" Timeout /T 1 /Nobreak"); writer.WriteLine(" Goto Loop"); writer.WriteLine(")"); writer.WriteLine("Del \"" + (new FileInfo((new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)).Name + "\""); } Process.Start(new ProcessStartInfo() { Arguments = "/C " + batchScriptName + " & Del " + batchScriptName, WindowStyle = ProcessWindowStyle.Hidden, CreateNoWindow = true, FileName = "cmd.exe" }); } GL HF