'Run SSH commands in Batch (Windows)
I need to login to the putty and run the below commands to complete the task.
putty.exe -ssh user@host -pw password -m c:\user\batchcommands.txt
1st Command :
cd/u01/app/oracle/user_projects/domains/COLLECT/EOD/bin_arm
2nd Command :
./FileUpload.sh
3rd Command :
cd/u01/app/oracle/user_projects/domains/COLLECT/EOD/bin_arm
4th Command :
./execute_eodarx.sh
How can I run these commands serially (completion of previous command)?
Solution 1:[1]
Write all commands in file with extension *.bat for e.g. auto_script.bat
Bat file is like shell scripts in windows and runs command in synchronous way.
then
putty.exe -ssh user@host -pw password -m "c: && cd path_to_file && auto_script "
Note : just use filename (of the bat file) as command in the directory. how to run bat file for cmd
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
