Task Schedule not working


  1. Posts : 4
    7
       #1

    Task Schedule not working


    Hi, I have a bat file that i would like to run every day. I set up my task schedule using Create Basic Task and I am working from windows 7. For some reason my task will not run. When I go open my excel worksheet where data suppose to load, nothing is there. When I go to Task Schedule History, its shows the file did run. Can anyone help me trouble shoot this issue.
      My Computer


  2. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #2

    What happens if you manually run the bat file by double-clicking it ?
    Does it run successfully ?
    If the CMD windows closes too fast to see what it did, add a pause statement as the last statement in your bat file.
    That will keep the CMD window open so you can see any error message(s) until you press a key to continue and exit the bat.

    You can post a screen print of your "Bat run window" using these instructions:
    Screenshots and Files - Upload and Post in Seven Forums
    Then folks here can see what you see.

    I assume you don't see any helpful error messages in the Task Scheduler History.

    You could also post the bat file source code.

    Just don't ever post any personal data such as username, userid, email address, password, license key, etc...
    Black that out in your screen print(s), if needed.
      My Computer


  3. Posts : 4
    7
    Thread Starter
       #3

    Hi David, The bat file runs successfully if I double click and run it. When I run it thru CMD window it run successfully as well. It doesn't want to run it when I schedule it using Schedule task, nothing happens. History says it ran but nothing gets posted in the file.
    Last edited by gill1123; 09 Jul 2015 at 15:33.
      My Computer


  4. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #4

    Add a pause statement as the last command in your bat file.
    Run it from the task scheduler.
    That should keep the CMD window open until you click on it.
    See if there are any messages displayed that might help.

    If you're not running the scheduled task using your Windows logon account you won't see the CMD window.
    Worst case, you would have to kill the task in task manager, if you don't see the CMD window and the task doesn't end.
      My Computer


  5. Posts : 4
    7
    Thread Starter
       #5

    I am not sure how to add a pause statement. This is what I have in my bat file:
    Last edited by gill1123; 09 Jul 2015 at 15:33.
      My Computer


  6. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #6

    Can you EDIT the bat file so it opens in notepad, and post a screen print of what you see in notepad ?
    Right click on your bat file, and click Edit.
    For me, that opens the file in Notepad, and does not run it.

    Screenshots and Files - Upload and Post in Seven Forums

    Here is an example of a bat file with the pause statement (edit in notepad)
    Task Schedule not working-batsourceexample_01.png
      My Computer


  7. Posts : 120
    Windows 7 Home Premium
       #7

    The problem may also depend where you are running the ".bat" file from.
    For example, I created a Task to run a exe program which was to output into a xml file. However I put the exe program file in Windows "Program Files" folder. It would work from the cmd line but not from task scheduler. I had to move the exe program to a different location (I just moved to my Documents folder. The output file went to a folder on a different drive).
    Perhaps this is same as your problem.

    Last thought - you may need to check the box "run with highest privileges" if its not already checked.
      My Computer


  8. Posts : 4
    7
    Thread Starter
       #8

    I have tried the pause statement & scheduled the task, nothing happens.

    CountryBumkin, I have changed my bat file location and it worked. Thank you so much! :)
    Last edited by gill1123; 09 Jul 2015 at 15:32.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:18.
Find Us