Task Scheduler: Batch file stuck in 'running' status


  1. Posts : 7
    Windows 7 Home Premium 64bit
       #1

    Task Scheduler: Batch file stuck in 'running' status


    I need to run a batch file using the System account when a user logs on. This is needed for Crashplan to see network drives, following the tip at The Crashplan Network Drive Workaround

    My batch file does the following:

    net use r: \\server\folder1
    net use s: \\server\folder2

    I have created the batch file and can run it myself just fine. However, when I run it via task scheduler, the status changes to Running and the drives aren't mapped. In troubleshooting I scheduled a batch file to just open Explorer, and I get the same result.

    Seeing other tips on this, I have specified the "Start in" field as the location of the batch file.

    Any idea on how to get it to run?
    Attached Thumbnails Attached Thumbnails Task Scheduler: Batch file stuck in 'running' status-task-scheduler-general.jpg   Task Scheduler: Batch file stuck in 'running' status-task-scheduler-action.jpg  
      My Computer


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

    My guess is you don't see the Explorer window because you are running the task as a different user (SYSTEM).
    Change the task to run using your User account and see what it does.

    Also Enable All Tasks History so you can see if there are any errors in the History tab.
      My Computer


  3. Posts : 7
    Windows 7 Home Premium 64bit
    Thread Starter
       #3

    Thanks. When I change it to my user account I get an error message "An error has occurred for task Test Batch. Error message: One or more of the specified arguments are not valid."

    However, I do not have any arguments specified.

    Here's my history - is there something specific to look for here?

    Thanks for your help.
    Attached Thumbnails Attached Thumbnails Task Scheduler: Batch file stuck in 'running' status-task-scheduler-history.jpg  
      My Computer


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

    I don't know why you get that error message when changing the user account.
    In the screen print in post #1 i see the Author is blank.
    I've never seen that before, i don't know why or how the Author is blank, maybe that is the problem.

    I would create a new task with
    - Run only when user is logged on
    - Don't check Run with highest privileges
    - For the program use explorer.exe instead of a BAT file

    That should create a "simple" task for testing.
    See if that works, and the task has your user for the Author.
    For me, when i run the task it opens an Explorer window.

    In the History list you can double click any entry and see if there are any error message(s) that might help.
      My Computer


  5. Posts : 10,485
    W7 Pro SP1 64bit
       #5

    DavidE said:
    ~~~
    In the screen print in post #1 i see the Author is blank.
    I've never seen that before, i don't know why or how the Author is blank, maybe that is the problem.
    ~~~
    I'm guessing that the Author was edited out of the screenshot by the OP; hence, the colored rectangle.
      My Computer


  6. Posts : 7
    Windows 7 Home Premium 64bit
    Thread Starter
       #6

    Thanks - I blocked out the author field for confidentiality :)

    This gets more bizarre. I have created a variety of new tasks, each to launch explorer, and varying the following attributes:

    Configure for (either Vista or Win7)
    Run with highest privileges checked on or off
    Start in C:\ or blank

    All launch explorer appropriately but they mostly stay stuck in the running status. Once in a rare while I can get a task to end in the Ready status if I have it configured for Win7 (my OS), running with highest privileges, and start in C:\. But if I delete that task, and create a new one with the exact same attributes, it gets stuck with a running status.

    Does that help anybody figure out what's wrong?
      My Computer


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

    I don't know why your task stays in the running status.
    When i manually run a simple task i created to run Explorer the status changes to Ready.

    In the Task History do you see an entry for Task Completed successfully ?
    Or, do you see any errors ?

    Back in post #1 you said
    I have created the batch file and can run it myself just fine. However, when I run it via task scheduler, the status changes to Running and the drives aren't mapped.
    Are you sure you need to run the scheduled task as SYSTEM ?
    Can you test running it with your userid to see if that works, and what it does ?

    Debugging a scheduled task that runs under a different user is more difficult.
      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 16:55.
Find Us