Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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.
mneekhra

.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%