0

I have to call two bat files.

One name cbpp_job and other upload.bat.

In first .bat files, I have called cbppservice.exe and after that I have call upload.bat.

cbpp_job.bat

call d:\csdb_exe\CBPPService.exe
call ftp -n -s:"d:\csdb\Success\upload.bat" xxxx.produrl.com

upload.bat

user XXXXXX
XXXXXXXXX

PUT ZA1P.FTP.CBPP.INTRFACE.GRP(+1) 'ZA1P.FTP.CBPP.INTRFACE.GRP(+1)'
BYE

EXIT

But when I call csdb_job through command prompt it works well. When I scheduled it in task scheduler it only calls cbppservice.exe and it is not doing the ftp.

The operating System is windows server 2008.

1
  • 1
    For what it's worth, a script file for ftp doesn't necessarily need a .bat extension, but that shouldn't be what's causing the problem. What I wonder is, does the ACL of d:\csdb\success\upload.bat allow reading by the machine's system account? Task scheduler doesn't run with the same permissions as the desktop user. Are there any hints about failures in your event logs that might indicate the source of the problem?
    – rojo
    Commented Apr 8, 2013 at 14:51

1 Answer 1

2

If your event viewer doesn't show you why your script is failing, Try modifying cbpp_job.bat to redirect stderr to a log file.

(
    d:\csdb_exe\CBPPService.exe
    ftp -n -s:"d:\csdb\Success\upload.bat" xxxx.produrl.com
) 2>"c:\csdbtask.log"

Maybe that'll help you figure out why task scheduler is failing.

Not the answer you're looking for? Browse other questions tagged or ask your own question.