Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Task Scheduler: Batch file stuck in 'running' status

26 Jun 2016   #1
MidwestSteve

Windows 7 Home Premium 64bit
 
 
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
Task Scheduler: Batch file stuck in 'running' status-task-scheduler-general.jpg  
Attached Images
Task Scheduler: Batch file stuck in 'running' status-task-scheduler-action.jpg 
My System SpecsSystem Spec
.
26 Jun 2016   #2
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

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 System SpecsSystem Spec
26 Jun 2016   #3
MidwestSteve

Windows 7 Home Premium 64bit
 
 

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
Task Scheduler: Batch file stuck in 'running' status-task-scheduler-history.jpg  
My System SpecsSystem Spec
.

27 Jun 2016   #4
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

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 System SpecsSystem Spec
29 Jun 2016   #5
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by DavidE View Post
~~~
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 System SpecsSystem Spec
02 Jul 2016   #6
MidwestSteve

Windows 7 Home Premium 64bit
 
 

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 System SpecsSystem Spec
02 Jul 2016   #7
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

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
Quote:
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 System SpecsSystem Spec
Reply

 Task Scheduler: Batch file stuck in 'running' status




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
How do I get Task Scheduler to stop running a deleted Task
I've been searching for days trying to find how to fix this issue. It came about when a hard disk crashed without warning and I didn't have a current backup. My bad, but fortunately it wasn't the system disk so I've been able to recover from the disk just dying. During the recovery phase, I...
General Discussion
Windows Task Scheduler Batch File
Hello: I have a Batch File, to move a file to a different folder, that I would like to run from Windows Task Scheduler on a windows server 2008 R2 . The batch file itself works, however running it from Windows Task Scheduler does not work. I am trying to move the file within the L drive. I...
General Discussion
Reading Task Scheduler Status Failed?
My system kept losing time (15sec a week), so I created a Task to Force Time Sync hourly- ImageShack® - Online Photo and Video Hosting Time.windows.com was 5sec Slow, so I change service to time.nist.gov (taskbar)- Time Service was Stopped, so I Started it in Services (delayed start). Then...
General Discussion
Task Scheduler - Win 7 64-bit - problem running .bat file "Hello..."
Hi, I'm having a problem trying to automatically run a basic .bat file in task scheduler in windows 7 64-bit. I have more complicated .bat files to schedule but I can't get a simple one to run. This is the .bat file: @ECHO OFF ECHO hello there...
General Discussion
Task scheduler unable to load task status/active tasks at startup.
My task manager is unable to load task status/active tasks at startup. I get the message: "The selected task "{0}" no longer exists. To see the current tasks, click Refresh." When I refresh I get the same message. I checked and found that under Microsoft the problem was in the defrag...
Performance & Maintenance
Windows Task Scheduler stays active after it runned a batch file
Hi small question, My batch file runs quite well in windows task scheduler, but it stays active. How can I make sure Task Scheduler finishes this? I am closing VLC player with a command ending with --play-and-exit and then vlc:quit (to kill the processes in the task manager).
Performance & Maintenance


Our Sites

Site Links

About Us

Find 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 15:10.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App