Sign in with
Sign up | Sign in
Your question
Solved

Task Scheduler will not run task

Tags:
Last response: in Windows 7
Share
May 22, 2011 8:09:23 PM

I have created a batch file that performs as expected when I double click on it, or run it from the Windows <Run> window. However, Task Scheduler will not run it. I am running Win7 Professional 64 bit. Screen shots of my setup for this task can be found at:

http://www.flickr.com/photos/rb_henard/sets/72157626656...

If the issue is in the Location line of the General tab being blank then (NOTE NOT the file location}:

1. Please tell me how to edit that line because I have NEVER been able to enter a value on that line

2. What should the location be.

Thanks
a c 209 $ Windows 7
May 22, 2011 9:23:34 PM

The "Location" item on the "General" tab shows you what folder the task is in in the left pane of Task Scheduler. It has nothing to do with the default folder that's in effect when the task runs.

The location is purely for the purposes of organizing your scheduled tasks. For example you could create a Task Scheduler folder by right-clicking on "Task Scheduler Library" in the left pane and select "New Folder", then naming the folder "Daily Jobs". You can't edit the "Location" field directly, but if you move your scheduled task into the new task scheduler folder then the "Location" field will change to reflect where it is now.

Can you post the details of the "action" for the task? Click the "Action" tab for the task, then highlight the action and click "Edit..." and post the resulting "Edit Action" dialogue box. That will show what command you're trying to run, what the command parameters are, and what the default folder is when the command is executed.

If we compare that to what you type in a Command Prompt window to run the program manually and what the default folder is when you do that, we can probably figure out where the problem lies.
May 22, 2011 11:01:26 PM

Quote:
Can you post the details of the "action" for the task? Click the "Action" tab for the task, then highlight the action and click "Edit..." and post the resulting "Edit Action" dialogue box. That will show what command you're trying to run, what the command parameters are, and what the default folder is when the command is executed.


Here is the screenshot of that window.

http://www.flickr.com/photos/rb_henard/5748631176/in/ph...

Note I've never tried running this batch file from a command prompt. Only by double clicking on it in from windows explorer or browsing to it from the Start-Run window.
Related resources

Best solution

a c 209 $ Windows 7
May 23, 2011 2:51:06 AM
Share

OK, then the problem is that you're going to need to come up with a command line that will run the program. You can't just paste a shortcut or document name into the Task Scheduler, it has to be the name of the program that opens or processes the document.

Assuming that "C:\Users\Public\Documents\PBA Folder Sync (batch).ffs" is the full filename of the file you're trying to run, open a Command Prompt window (Start, type "cmd" into the search box and press ENTER) and try typing the following into the window followed by the ENTER key:

start "" "C:\Users\Public\Documents\PBA Folder Sync (batch).ffs"

Note that the extra pair of "s after "start" are required.

Does that start the program? If so, then what you want to do is to change the Action of your scheduled program to put the following into the "Program/Script" box:

cmd

...and the following into the "Add arguments (optional)" box:

/c start "" "C:\Users\Public\Documents\PBA Folder Sync (batch).ffs"
May 23, 2011 3:58:21 PM

That worked. MANY THANKS
May 23, 2011 3:58:52 PM

Best answer selected by Blue_Ridge.
January 30, 2013 5:57:46 PM

I had to reply because I could not find anything on the net that helped me. So I thought I would help others....

After an hour or better of struggling with this similar thing, I figured out that you have to mount a network share "IN YOUR BATCH FILE" to get the output to be copied to that network share.

My suggestion, first try to adjust your batch file to write the output to a LOCAL drive. If that works, then use the "net use" commands to mount and dismount the drives.

net use I: \\ip of machine\folder
command to run
net use I: /delete


arrrgggghhh..... I hate task scheduler and windows for that matter. but if you have to use it.......make it work for you. MS ripped off linux and unix for everything else....you think they could have taken cron to....






April 23, 2013 5:39:49 AM

Hi,
I have a similar problem but my situation e little bit different, My script is supposed to rename a XML file with the local hour and then copy it to a different location. Well the copy its made but rename cicle not. Can you guys help me?

Here is the code:
  1. For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
  2. @ECHO %mytime%
  3. FOR %%d in (*.xml) DO (
  4. rename %%d %%~nd%mytime%".xml"
  5. )
  6.  
  7. copy c:\folder\*.xml \\server\folder1\
  8. copy c:\folder\*.xml \\server\folder2\
  9.  
  10. move c:\folder\*.xml c:\folder\transffered

This Scrpt runs in Windows XP But its not working in Windows 7 32 BIT

Thanks
April 26, 2013 6:46:47 AM

Sovled the problem:
In ActionTab, text box "Start in", inserted "c:\folder\" and worked well!
!