2010-02-01 57 views

Respuesta

18

puede utilizar la clase de proceso para ejecutar un archivo por lotes

Dim psi As New ProcessStartInfo("Path TO Batch File") 
psi.RedirectStandardError = True 
psi.RedirectStandardOutput = True 
psi.CreateNoWindow = False 
psi.WindowStyle = ProcessWindowStyle.Hidden 
psi.UseShellExecute = False 

Dim process As Process = Process.Start(psi) 
+3

gracias, es mejor agregar psi.WorkingDirectory = "Ruta TO Dir "también. –

1

La mejor manera es utilizar el Process.Start y pasar la ruta de acceso al archivo por lotes

Process.Start(pathToBatchFile) 
6

método simple y directo

System.Diagnostics.Process.Start ("c: \ lote. bat ")

0

'La forma más fácil si conoce la ubicación exacta del archivo es

System.Diagnostics.Process.Start ('c: \ prueba \ file.bat')

' En Visual Studio el archivo debe existir en el directorio/bin/debug o/bin/release dependiendo de su configuración de generación actual

System.Diagnostics.Process.Start ("test.bat")

Cuestiones relacionadas