Link to home
Start Free TrialLog in
Avatar of jsears1979
jsears1979

asked on

PSFTP Automation using batch file

Hello,
I have been looking forever and I just cant make sense of the process to automate a process using batch files and psftp from windows 2k3 to an sftp site.
I was able to write a ssh script that opens the psft application, inputs the correct login sequence informatino and transfers the files. The only issue here is that it can only run when i am logged into the server. I need to be able to create batch files that will automate the process, but cant find too much information on the web to do this.
Any help would be greatly appreciated.

Thank You,
jsears1979
Avatar of Member_2_908359
Member_2_908359
Flag of France image

in theory you can use the windows schedule to trigger this with no open session. Just specify which account should be used to start the task if specific rights are required, otherwise system account rights will be used. Normally everythin whihc can be lauched from the command line with no other user interaction can be launched this way; visible from the desktop depens on task parameters, and if a session is open. Ig no session is open errors will be logged in the event viewer.
Avatar of jsears1979
jsears1979

ASKER

Here is the process that I am currently using...
Batch file is scheduled to open psfp application, change the name of the file and run the ssh script that inputs the information into the psftp prompts. The ssh script inputs the correct information, deletes the file upon successful upload and exits/closes the psftp application. Again, this works flawlessly when I run it manually by double clicking the first batch file to kick off the whole process... the problem is that when I schedule it and it tries to run when I am not logged in, it cant open the psftp application. I have full admin rights to the server, so I do not think that is the issue. It is more an issue of getting an psftp session to run when I am not logged in.

Thanks
why don't you run psftp directly? why is ssh required to input "correct information" and delete a file?
this whole thing could be a regular shell script doing the "pre" and "post" steps, and call psftp in between with the right arguments?
have you tried to change the account starting the scheduled task or not?
This is on a server and it needs to be a scheduled task to run in the evenings nightly. I cant run psftp directly unless i want to log into the server every night and open it. I use my account on the server which has complete admin priveleges. I have tried using another service account as well as1 other admin ID. The shell script would use the send keys command to type in the account and login information without a user having to do it.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_908359
Member_2_908359
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.