Scrip | Task Scheduler (Never Finish)

Asked

Viewed 45 times

0

Hello I created the . BAT that deletes files from the previous day and then opens Winscp and runs a Script

@echo off
C:
cd C:\Unigrupo\
forfiles -p "C:\Unigrupo\ARQUIVOS_GERADOS" -d -1 -m *.csv -c "cmd /c del /f /q @path"
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script=C:\Unigrupo\AcessoWinScpUnigrupo.txt
pause
exit

And the Script it calls opens a specific IP, with user and password and plays the files . CSV inside the HOME directory of this SFTP:

open sftp://root:[email protected]
cd /home
lcd C:\Unigrupo\ARQUIVOS_GERADOS
put "*.*"
close
cd..
cd..
cd..
exit

My problem is that when I put the BAT to run inside the Windows Server 2012 R2 Standard Task Scheduler it just runs and NEVER finishes. (Nor copies the files inside Winscp) If I roll it in my hand, it copies right.

I read that it might be something in the codes, but I have no idea what it is.

Can help?

  • Which user you set up to run the bat can be this.

  • Ricardo, configured to run with the "Administrator Name" Started, "Run with the logged in user or not"

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.