Task Scheduler not running bat files
Results 1 to 12 of 12

Thread: Task Scheduler not running bat files

  1. #1
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352

    Task Scheduler not running bat files

    I have had several bat files that used to run at certain times throughout the day, but despite the status showing as Ready, they don't run anymore. If I right click and tell it to run, nothing happens. If I run the file manually, they work fine.

    The script is using wscript.exe
    Arguments: C:\xcopy backups\Batch files\Scripts\BatchLauncher.vbs" "C:\xcopy backups\Batch files\Copy_CR.bat"
    Start in: C:\xcopy backups\Batch files\

    Any suggestions?

    KZ

  2. #2
    Join Date
    Feb 2000
    Location
    Idaho Falls, Idaho, USA
    Posts
    15,751
    What version of Windows are you using?

    Is the Task Scheduler Service running?

  3. #3
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352
    Windows 7 Home Premium SP1

    Yes, the scheduler is running.

  4. #4
    Join Date
    Mar 2009
    Location
    Arkham Asylum, Cell 13
    Posts
    10,623
    It's better to NOT use spaces in folder names. I'd at least use underscores. xcopy_backups vs. xcopy backups.

    Try adding double quotes around all paths.

    Arguments: "C:\xcopy backups\Batch files\Scripts\BatchLauncher.vbs" "C:\xcopy backups\Batch files\Copy_CR.bat"
    Start in: "C:\xcopy backups\Batch files\"

  5. #5
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352
    Thank you! I'll work on that and see how that goes!

    BTW, I'll be out for a few days, so if I don't respond, I haven't forgotten....

  6. #6
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352
    It still does not work. Any other suggestions?

  7. #7
    Join Date
    Mar 2009
    Location
    Arkham Asylum, Cell 13
    Posts
    10,623
    So the job was working in Task Scheduler, and then it just stopped working?

    If I run the file manually, they work fine.
    How exactly are you running these files manually? Are you opening a command prompt and running
    wscript.exe C:\xcopy backups\Batch files\Scripts\BatchLauncher.vbs" "C:\xcopy backups\Batch files\Copy_CR.bat"

    What path are you using to wscript.exe? It should be in C:\Windows\System32

  8. #8
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352
    Yes, it had been working, but stopped some time ago.
    I can run them manually from my batch file folder by just double-clicking on them.

    I'm using wscript. I'm not sure where it's pointing to because that is the only text that is in the exe path. Do you think I need to re-setup the exe path?
    All the directories now have complete folder and file names without spaces, but that didn't change anything...although a good idea.

  9. #9
    Join Date
    Mar 2009
    Location
    Arkham Asylum, Cell 13
    Posts
    10,623
    I can run them manually from my batch file folder by just double-clicking on them.
    That's not the same thing. You're not running the same full command path.

    Did you set up the task scheduler job? Unless you set the path variable, you need to set the full path of the .exe.

  10. #10
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352
    Is this file required in the "Add arguments" section?
    "C:\xcopy_backups\Batch_files\Scripts\BatchLauncher.vbs"

    I did notice this evening that several of the scripts show "The system cannot find the path specified" and "The directory name mis invalid." Not sure what's up with that. Wondering if it's the vbs file. In the arguments section I have the BatchLauncher followed by the bat file name.

  11. #11
    Join Date
    Mar 2009
    Location
    Arkham Asylum, Cell 13
    Posts
    10,623
    Is this file required in the "Add arguments" section?
    "C:\xcopy_backups\Batch_files\Scripts\BatchLauncher.vbs"
    Didn't you write those scripts? What are you trying to do exactly?

    That's why I asked if you tested the command from a command prompt. If it doesn't work there, it probably won't work in Task Scheduler.

    Normally, you'd use wscript.exe to run one script. I'm not sure how your .vbs works with the .bat file.

  12. #12
    Join Date
    Sep 2000
    Location
    Allen, TX, US
    Posts
    352
    Yes, I did write those bat scripts. They work perfectly from a command prompt.
    Someone on this forum a long time ago had me put that vbs in there. I'll have to research that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •