cmd - VBscript For Command Prompt Windows 7 -


i wondering if me please. running script several things me. first open command prompt, telnet location, there several other commands, exit prompt when commands have executed. part work without issues. if possible, replace lines “wscript.sleep 500” else such “wscript.screen.waitforstring "word: "”. check prompt line or keyword before executing next line of code. sleep time short , cause script error or prevent next line executing. if make sleep time long waiting time out when next line of script running.

here using, part work (unless there time issue):

set cloner = createobject("wscript.shell") cloner.run"cmd" wscript.sleep 500  cloner.sendkeys"telnet servername" cloner.sendkeys("{enter}") wscript.sleep 500  cloner.sendkeys"user id" cloner.sendkeys("{enter}") wscript.sleep 500  cloner.sendkeys"password" cloner.sendkeys("{enter}") wscript.sleep 500 

i this, can't work:

set cloner = createobject("wscript.shell") cloner.run"cmd" wscript.sleep 500  cloner.sendkeys"telnet servername" cloner.sendkeys("{enter}") wscript.screen.waitforstring "username: "  cloner.sendkeys"user id" cloner.sendkeys("{enter}") wscript.screen.waitforstring "password: "  cloner.sendkeys"password" cloner.sendkeys("{enter}") wscript.screen.waitforstring "servername: " 

i can't wscript.screen.waitforstring work, or similar it. please let me know if has suggestions. thanks.


Comments