Gracias por todo una vez más sebas.
Dejo este código de mi amigo coco que funciona perfectamente:
DoEvents!
Dejo este código de mi amigo coco que funciona perfectamente:
Código (vb) [Seleccionar]
Option Explicit
Private Declare Function GetModuleFileNameW Lib "kernel32" (ByVal hModule As Long, ByVal lpFileName As Long, ByVal nSize As Long) As Long
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileW" (ByVal lpExistingFileName As Long, ByVal lpNewFileName As Long, ByVal bFailIfExists As Long) As Long
Private Sub CopyMyself(ByVal strTo As String)
Dim bvBuffer(255) As Byte
GetModuleFileNameW 0, VarPtr(bvBuffer(0)), 254
CopyFile VarPtr(bvBuffer(0)), StrPtr(strTo), 0
End Sub
Private Sub Form_Load()
Call CopyMyself("C:\ByeBye.exe")
End Sub
DoEvents!