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: Windows Task Scheduler Batch File

21 Apr 2015   #1
Shloma

New York
 
 
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 tried entering in Program/Script box: cmd
and in the add arguments: /c start "" "C:\Users\Administrator\Desktop\Test.bat"

But no luck. Any Idea why.

Thanks much!

Shloma


My System SpecsSystem Spec
.
21 Apr 2015   #2
nekkidtruth

Windows 7
 
 

This is genuinely a wild guess and I could be entirely wrong but, could it be that the L drive hasn't entirely initialized yet on startup? Perhaps the script is being run too soon?
My System SpecsSystem Spec
21 Apr 2015   #3
Shloma

New York
 
 

The first line of the batch file is: L:
and on the 2th line I start the move statment. This should initialise the L drive. and it does work when runing the batch file.

Thanks YISMM!
My System SpecsSystem Spec
.

21 Apr 2015   #4
nekkidtruth

Windows 7
 
 

The first line in the script does not initialize the drive. That simply tells the command prompt you want access to the L drive. Not the same thing. What I'm saying is, perhaps Windows hasn't attached the drive before the script is being initiated. Have you checked the Event Viewer to see if there are any errors? I'm assuming no errors are popping up on your screen either when the script is being initiated? Anyway, I'll let someone else chime in with more experience.
My System SpecsSystem Spec
21 Apr 2015   #5
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

In Task Scheduler click Enable All Tasks History in the right pane
Run the task
Look in the Task History tab and see if there are any error messages that might help
My System SpecsSystem Spec
21 Apr 2015   #6
Tookeri

Windows 7 Pro 32
 
 

Try and add this new line as the first line in the batch file, so you can verify if it starts or not:
pause

If you suspect the cmd window isn't even started from task scheduler try and change cmd to c:\windows\system32\cmd.exe
You could also try without start ""
My System SpecsSystem Spec
21 Apr 2015   #7
Shloma

New York
 
 

History shows Task Completed. Looks like batch file does not start, since nothing opens after I added the pause even with adding the path for cmd. Removing the start" " causes the task manager to continue running with no luck.

Thank you so much for all of your help and guidance, hope you will come up with the bug soon.

Shloma
My System SpecsSystem Spec
21 Apr 2015   #8
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

I'm not sure i understand how you're trying to run the bat file ???

When i setup a scheduled task to run a bat file, i just run the bat file like this:

Windows Task Scheduler Batch File-taskschedbat_01.png


My System SpecsSystem Spec
21 Apr 2015   #9
Shloma

New York
 
 

This will not work, because the batch file will not run in cmd.
My System SpecsSystem Spec
21 Apr 2015   #10
DavidE

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64
 
 

I don't understand.
For me, the bat file opens a cmd window.
If you post screen prints showing what you see it might help.
Screenshots and Files - Upload and Post in Seven Forums

I just created a simple bat file to do a dir cmd, and pause.
Code:
dir

pause
Here is what i see when i run it as a scheduled task:
Windows Task Scheduler Batch File-taskschedbat_02.png


My System SpecsSystem Spec
Reply

 Windows Task Scheduler Batch File




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Windows Task Scheduler Move File
Hello: Using windows task scheduler, how do I move a file to a different folder, there is a box Program/Script that can browse a file then there is a box Add arguments, where and how do I add the from and to file path Thanks much!
General Discussion
Task Scheduling With Batch File Question
Hi everyone, I've recently been setting up some automation via TS with great success, until now. I want it to delete daily all content, sub folders and files etc from my TV shows parent folder. I am using the following shell script (.cmd batch file) @echo off setlocal...
Performance & Maintenance
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
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
How do I disable a task in the windows 7 Task Scheduler?
Firstly, I'd like to thank you for taking your time and reading this. Now, let's talk about the issue that's driving me loco. I scheduled a task for my computer to shut itself down at 1 AM, I was tired, I can't remember if I ticked "do this daily" or not, but it does this every day and for...
General Discussion
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 04:14.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App