Ver Mensaje Individual
  #7 (permalink)  
Antiguo 25/05/2011, 08:34
msgambero
 
Fecha de Ingreso: octubre-2005
Mensajes: 3
Antigüedad: 18 años, 7 meses
Puntos: 0
Pregunta Respuesta: Ejecutar un BAT desde VB

He seguido tus instrucciones, pero me da un error que no me deja seguir, diciendo lo siguiente:

"Error de compilación:
Los comentarios solmanente puedenaparecer después de End Sub, End Function o End Property"

Señalando la definición de la función, ¿por qué?

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long



Cita:
Iniciado por Jorge_Mota Ver Mensaje
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
'KPD-Team 1998
'URL: [url]http://www.allapi.net/[/url]
'E-Mail: [email][email protected][/email]
'Send an E-Mail to the KPD-Team
ShellExecute Me.hwnd, vbNullString, "c:\tuCarpeta\archivo.bat", vbNullString, "C:\", SW_SHOWNORMAL
End Sub


si no quieres que se vea la ventana de DOS al ejecutarse el punto bat
en lugar de SW_ShowNormal en le penultima linea, pon Un Cero.