.bat to script file

Advertisement

mneekhra
Joined:
Posts:
1
Location:
India

.bat to script file

Hello there
I newly created a bat file for a ftp job automation and the same is running fine from command prompt but from windows task scheduler it is giving error so I want to convert it to script file, could you please tell me how to do that .

"C:\Program Files\WinSCP\WinSCP.com" ^
  /log="C:\Users\Admin\Desktop\FTPAuto\WinSCP.log" /ini=nul ^
  /command ^
    "open ftp://uname:password@ftp.demo.com/" ^
    "option confirm on" ^
   "lcd C:\ftp" ^
   "get -neweronly *.mdf" ^
   "exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
  SwithMail.exe /s /x "C:\Users\Admin\Desktop\FTPAuto\Success_Mail.xml"
) else (
  echo Error
  SwithMail.exe /s /x "C:\Users\Admin\Desktop\FTPAuto\Fail_Mail.xml"
)
del C:\Users\Admin\Desktop\FTPAuto\WinSCP.log
exit /b %WINSCP_RESULT%

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
34,147
Location:
Prague, Czechia

Re: .bat to script file

Why do you think that converting it to a script file would help? Rather tell us more about the error you are getting. A session log file would help.

Btw, using option confirm on from a task scheduler looks like a bad idea.

Reply with quote

Advertisement

You can post new topics in this forum