Calling putty from a batch file when setting up ssh tunneling
Posted on 2008-10-21
I am using putty to set up ssh tunneling by checking the "don't start a command or shell at all" checkbox. This works fine.
I have tried to set up a windows batch file to start my IDE and also to kick off several instances of putty for the ssh tunnels. This does not work because for some reason starting ssh in this way does not return processing to its parent shell.
Normally you can execute commands asynchronously in windows by the following method:
- suppose you wanted to execute from a batch file the following command: "my_job my_paramters"
- normally the above command in a batch file waits until the job completes before returning for the next line of the batch file
- the usual method to cause the command to be processed asynchronously is as follows: "cmd /c my_job my_paramters". This cmd /c causes a new shell to be initiated with an immediate return to the batch file
However, this does not work with the "don't start a command or shell at all" setting in putty. I have also tried using "start" which is another approach.
Any ideas of how I could put the putty invocation of the ssh tunnel into a batch file?