Batch job hangs on putty.exe call

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
redboy33
Posts: 14
Joined: Fri May 15, 2009 6:38 am

Batch job hangs on putty.exe call

Post by redboy33 » Thu Jun 04, 2009 12:46 am

Hey All,

I know batch files are kinda uncool in the days of vbscript and powershell (whatever that is?) but I'm run a simple batch job that hangs when I tell it to open putty.exe.

My batch file looks similiar to this:

@echo off
ipconfig /flushdns
nbtstat -RR
regedit.exe /s proxyYES.reg
putty -D 22300 -P 443 -ssh some.website.com
start iexplore http://www.yahoo.com
quit

It will run everything up to the putty line. putty opens a connection to some.website.com where I can logon to a server for whatever reason.. since putty has to remain open the batch file will not go to the "start iexplore http://www.yahoo.com" line?

if I take out the putty line, intertet explorer opens up to yahoo.com.

I'm practically a newbie to writing batch files and vbscript so please excuse me if this is an easy fix OR not possible.

Thanks in advance,

Redboy

User avatar
redboy33
Posts: 14
Joined: Fri May 15, 2009 6:38 am

Batch job hangs on putty.exe call

Post by redboy33 » Thu Jun 04, 2009 12:46 am

Hey All,

I know batch files are kinda uncool in the days of vbscript and powershell (whatever that is?) but I'm run a simple batch job that hangs when I tell it to open putty.exe.

My batch file looks similiar to this:

@echo off
ipconfig /flushdns
nbtstat -RR
regedit.exe /s proxyYES.reg
putty -D 22300 -P 443 -ssh some.website.com
start iexplore http://www.yahoo.com
quit

It will run everything up to the putty line. putty opens a connection to some.website.com where I can logon to a server for whatever reason.. since putty has to remain open the batch file will not go to the "start iexplore http://www.yahoo.com" line?

if I take out the putty line, intertet explorer opens up to yahoo.com.

I'm practically a newbie to writing batch files and vbscript so please excuse me if this is an easy fix OR not possible.

Thanks in advance,

Redboy

User avatar
jhicks
Posts: 1789
Joined: Sun Jan 21, 2007 11:31 pm

Batch job hangs on putty.exe call

Post by jhicks » Thu Jun 04, 2009 12:57 am

There's nothing wrong with still using batch files. I still do because they are quick and get the job done.Your script really isn't "hanging", it is simply waiting for the putty command to finish. I think you can get around it by using the START command.start putty -D 22300 -P 443 -ssh some.website.com

User avatar
redboy33
Posts: 14
Joined: Fri May 15, 2009 6:38 am

Batch job hangs on putty.exe call

Post by redboy33 » Thu Jun 04, 2009 9:20 am

There's nothing wrong with still using batch files. I still do because they are quick and get the job done.Your script really isn't "hanging", it is simply waiting for the putty command to finish. I think you can get around it by using the START command.start putty -D 22300 -P 443 -ssh some.website.com





Worked like a charm!!! Thanks..

Locked