Combining multiple lines of telnet into 1 batch file -


to perform specific task had following commands

telnet 10.0.0.192 *hit enter y (answer yes whatever question comes up) *hit enter domain\username (when prompted username) *hit enter password (when prompted password) *hit enter \\10.0.0.2\path\batchfile.bat (this batch file i'd run in end) *hit neter 

is there way can combine data 1 batch file (saving passwords fine) have double click batch file , ends executing batchfile.bat on remote server?

it not possible automate entierly using batch file. can use vbs script manage session. here's example of such script (called dotelnet.vbs, sake of example):

    set myshell = createobject("wscript.shell")     myshell.run "cmd"     wscript.sleep 100      myshell.sendkeys"telnet 127.0.0.1"     myshell.sendkeys("{enter}")     wscript.sleep 100  etc... 

you call batch file with:

cscript dotelnet.vbs 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -