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
Wednesday, October 19, 2011
How to FTP file from Windows to UNIX using bat file
1. Install WinSCP in your windows box.
2. Use the command below to ftp the file. Save the below file as bat file (e.g. ftp.bat)
cd ../..
cd "Program Files"/WinSCP
WinSCP.com username:password@servername /command "option confirm off" "put Source location target location" "exit"
exit
e.g.
Source location -- C:\TEST
target location -- /data/TEST
3. Complile the file to exe file using Bat_To_Exe_Converter. New file name will be like (ftp.exe)
http://www.f2ko.de/
4. Call the ftp.exe file inside a bat file
C:\ftp\ftp.exe
2. Use the command below to ftp the file. Save the below file as bat file (e.g. ftp.bat)
cd ../..
cd "Program Files"/WinSCP
WinSCP.com username:password@servername /command "option confirm off" "put Source location target location" "exit"
exit
e.g.
Source location -- C:\TEST
target location -- /data/TEST
3. Complile the file to exe file using Bat_To_Exe_Converter. New file name will be like (ftp.exe)
http://www.f2ko.de/
4. Call the ftp.exe file inside a bat file
C:\ftp\ftp.exe
Subscribe to:
Posts (Atom)