Reputation: 462
I asked a previous question about downloading file unattended on a server, using VBScript and Windows Task Scheduler. (See Scripting SFTP unattended download )
That works great but now I also need to delete the files from the server I am calling:
Set sessionses = WScript.CreateObject("WScript.Shell")
sessionses.Run "C:\TCS\SFTP\delThem.bat", , True
PSFTP calling a batch file that runs this command:
psftp user@host:22 -batch -b script.txt -pw pa$$word
script.txt is as follows:
cd FromCeridian
del *.GEN
If I run this command from the command line, or double click the batch file containing the command, it works "interactively", but when running unattended and scheduled, it doesn't do this part. The server is SFTP, so I can't just use win ftp commands to do it.
Any ideas?
Upvotes: 0
Views: 975
Reputation: 54
Check the security options of your task to verify the user identity has correct access privileges.
Upvotes: 0