Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/06/2011, 10:44
June310
 
Fecha de Ingreso: marzo-2011
Mensajes: 70
Antigüedad: 13 años, 2 meses
Puntos: 2
El msdos se vuelve loco cuando le envio un shell en vb6

Hola a todos tengo un codigo en donde utilizo shell para al momento de activar el form se ejecute un .bat, este me funciona bien, pero despues vuelvo a utilizar otro shell con sendkesy este es el codigo

Código:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "C:\WINDOWS\system32\cmd.exe"
Sleep 20
WshShell.SendKeys "chdir C:\Archivos de programa\ArcGIS\Bin"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "psql.exe -d " & ComboBox1.Value & " -h 172.16.5.55 -U lety"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "\o tablas.txt"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "\pset tuples_only"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "\dt"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "\q"
WshShell.SendKeys "{Enter}"
WshShell.SendKeys "exit"
WshShell.SendKeys "{Enter}"
ComboBox2.Clear
cuando ejecuto este ultimo el msn se vuelve loco y empieza abrir muchas ventanas y no se porque tengo quecerrar todo volver a ejecutar el programa y despues ya funciona, quisiera saber si alguien me peude ayudar, no se como resolver este problema.