Wednesday, October 19, 2011

How to call UNIX shell script from Windows bat file

1. Install PUTTY in your windows box.
2. Use the command below to run unix command from windows . Save the below file as bat file (e.g. run_unix_cmd.bat)

cd ../..

cd "Program Files"/PuTTY

plink.exe -ssh -pw "password" -noagent "username"@"server name" sh "location of shell script"

e.g.

location of shell script -- /data/token_file.sh