0

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?

Community
  • 1
  • 1
ScottC
  • 452
  • 8
  • 25

1 Answers1

0

Check the security options of your task to verify the user identity has correct access privileges.

John Gwynn
  • 54
  • 3
  • the task (and the script) downloads, moves, and deletes local files, but just doesn't seem to run the PSFTP batch command – ScottC Dec 03 '12 at 14:42
  • also its the Administrator Account running with highest privileges – ScottC Dec 03 '12 at 14:56