0

I have a batch file daily.bat, this is the code:

cd C:\inetpub\wwwroot\infoweb\factuur\cron

c:\PHP\php.exe -f ./cron_pdf.php

ftp -s:ftp_upload.txt ftp.infoweb.be

And I created a task with task scheduler in windows 7. When I run the batch manually, everything goes fine, but when I try to run it with the task scheduler nothing happens.

My action is 'run script' "C:\inetpub\wwwroot\infoweb\factuur\cron\daily.bat"

UAC is off and I am Admin.

Any idea why this is not working?

Thanks

  • This is a better fit for super user - it should get transferred there automatically. – user35787 Dec 14 '10 at 9:50
1

ok it is working now this is what I did, you probably won't need all these steps to make it work but just to be sure try them all:

  • Check the account parameters of your scheduled task and make sure they are set to run whether or not someone is logged into the machine

  • check run with most privileges/rights

  • Make sure you go to the full path first: cd C:\inetpub\wwwroot\infoweb\factuur\cron

  • Don't use double quotes in your batch files (don't know why but seems to help)

  • Be super admin, enter 'Net user administrator /active:yes' in command prompt, log out and log in as the super admin, so UAC is off

Thanks guys

0

Check the account parameters of your scheduled task and make sure they are set to run whether or not someone is logged into the machine and the password is saved

  • thanks but I already did that, and I also checked run with most privileges/rights – Ruben Dec 14 '10 at 9:52
0

I was having troubles with running a batch file which does compress all files in a folder, moves the compressed files away and deletes the original files. It was working on W2K3 but on W2K8R2 it didn't work anymore - got success when running the batch but nothing helped.

I followed all suggestions from Ruben but no joy.

After some time I found the problem: On W2K3 the batch file was run in the directory where the batch file resided whilst on 2K8 it opens cmd with default path. So I had to explicitly cd to the corresponding drive + directory in order for it to run.

  • 2
    great, I think this is what I meant with 'Make sure you go to the full path first', windows batch files can be a pain in the ass – Ruben Jul 11 '13 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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