Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

closing a dos batch script

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
CA
Hi there,
I have a batch script that opens up a program (putty) and automatically logs me into a SSH session.

Code:
C:\putty.exe -load "server1"  -l root -pw password

The problem I have is that, when the program putty.exe opens and logs me in, I want to close the command line window.

Is there a command I can execute after this cmd script that will close the main console window?

I am sorry if this is the wrong place for a question like this, but I found that this was the most relevant place searching trough the forums.

Thanks !
 
I'm not sure this is the best place for batch scripting questions...

but I will say a lot depends on how you are opening this batch file. If you open up the console to run it, the console will remain after you run the file.

You can always try inserting "exit" and see if it changes anything.
 
If you started putty with "start C:\putty.exe <...>"you would have been able to close the batchfile by using the Exit command.

Why not just create a shortcut to putty.exe and add the extra parameters at the commandline after putty.exe, just like in the batchfile? You can now also attach a nice (putty-standard) icon to the shortcut, and it should act exactly the same.

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top