×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

closing a dos batch script

closing a dos batch script

closing a dos batch script

(OP)
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 !

RE: closing a dos batch script

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.

RE: closing a dos batch script

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close