Foros del Web » Programación para mayores de 30 ;) » .NET »

Problema al querer ejecutar script desde Visual basic

Estas en el tema de Problema al querer ejecutar script desde Visual basic en el foro de .NET en Foros del Web. Hola, Tengo un problema quiero ejecutar un script VBS que abre puertos en un modem: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "telnet 192.168.1.254", 9 WScript.Sleep 500 ...
  #1 (permalink)  
Antiguo 17/11/2015, 10:54
 
Fecha de Ingreso: noviembre-2015
Mensajes: 1
Antigüedad: 8 años, 5 meses
Puntos: 0
Problema al querer ejecutar script desde Visual basic

Hola,

Tengo un problema quiero ejecutar un script VBS que abre puertos en un modem:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "telnet 192.168.1.254", 9
WScript.Sleep 500
WshShell.SendKeys "TELMEX"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "0F15AF5A01"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "wireless ifconfig state=enabled"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "saveall"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "exit"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "Timeout 15"
WshShell.SendKeys "{ENTER}"

Esto lo hago a traves de un archivo .bat

cscript "Modem.vbs"

Timeout 20

y lo llamo en visual con

Dim psi As New ProcessStartInfo("Modem.bat")
psi.WorkingDirectory = "J:\Sourcesafe 2\Sentinel SMI\SentinelSMIManager\SYS_PR_SentinelSMIManager.C V\bin\Debug\ScriptsSentinelSMI"
psi.WindowStyle = ProcessWindowStyle.Maximized
Process.Start(psi)

el problema es que me sale que no encuentra el archivo especificado dentro del bat, ya intente poniendo la ruta completa del script y aun así no funciona ya probé mi script desde cmd con cscript y funciona bien, tambien ya probé dando doble click en mi archivo bat y funciona bien el problema solo es en visual no se si alguien sepa a que se debe esto.


Agradezco su tiempo por leer esto y ojala me puedan ayudar

Etiquetas: basic, ejecucion, scripts, visual
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:46.