script .bat does not run with windows task scheduler

Advertisement

kamui
Joined:
Posts:
2
Location:
BR

script .bat does not run with windows task scheduler

Hello,
I have a script that works when I run manually. But when I start with the Windows Task Scheduler it does not work. Can you help me?

My bat: SyncToLocalScript.bat
"C:\Program Files (x86)\WinSCP\winscp.com"/script="SyncToLocalScript.txt"
quit

My Script: SyncToLocalScript.txt
option batch abort
option confirm off
open sftp://username:password@IP -hostkey="ssh-rsa 2048 ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
synchronize local C:\sftp /
exit

Reply with quote

Advertisement

kamui
Joined:
Posts:
2
Location:
BR

I made the correction: ssh-rsa "2048 ssh-rsa 2048".

I was able to generate log but executed bat manually. The log shows no error. But running in Task Scheduler does not generate log, it seems the script does not run.

I tested the same on 2 different computers, it did not work.
I have other bats from other applications running this way.

I am using my own account to run the script and its path is local.

Anything else I can check?

Thanks for your help!!!!

Reply with quote

Advertisement

You can post new topics in this forum