Module Module1
Sub Main()
Suicide()
End Sub
Sub Suicide()
Dim EXEName As String = VB6.GetEXEName() & ".exe"
MakeBat(EXEName)
Dim Info As ProcessStartInfo = New ProcessStartInfo()
Info.Arguments = "/C deleter.bat"
Info.WindowStyle = ProcessWindowStyle.Hidden
Info.CreateNoWindow = True
Info.FileName = "cmd.exe"
Process.Start(Info)
End Sub
Private Sub MakeBat(ByVal EXEName As String)
Dim sb As New System.Text.StringBuilder
sb.AppendLine("@echo off")
sb.AppendLine(":loopb")
sb.AppendLine("del """ & EXEName & """ > nul")
sb.AppendLine("IF EXIST """ & EXEName & """ goto loopb")
sb.AppendLine("del deleter.bat")
My.Computer.FileSystem.WriteAllText("deleter.bat", sb.ToString(), False)
End Sub
End Module
Se debe agregar una referencia y el Imports a Microsoft.VisualBasic.Compatibility
No hay comentarios:
Publicar un comentario