The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-12-2009
mohantmk mohantmk is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 9
Thanks, I will use PSFTP instead of PSCP.

I have few questions if i use PSFTP

I am using the below syntax to connect to server,
psftp.exe -l testlogin -pw testpassword -b script.bat host.name.net
all my file movement code in script.bat

script.bat contains:
cd SERVER/GETFILE
lcd C:\INBOUND
get Test one.txt
quit


1. How to get latest file from the server, example i am using test one.txt
2. How to get return codes from the script.bat
3. How to rename file name "Test one.txt" to "YYYYMMDDHHDDSS.txt" when GET
4. How to rename file name "YYYYMMDDHHMMSS.txt" to "Test one.txt" when PUT

Can you please clear my questions i can do all these using PSCP but, when i use code in the script.bat it doesn't recognizes keywords like "@ echo off" "IF" "SET etc.


If i have a way to delete file using PSCP, or any idea to delete that file from server from the same script program i dont have to change all the code again.

--
Thanks
Mohan