Solved

bat file in task scheduler.

Posted on 2013-11-22
8
453 Views
Last Modified: 2013-12-05
I am trying to run simple bat file in windows task scheduler and it is not running.
This is what I did in the action box
Pointed to c:\myfile\test.bat, but this file runs when I double click on desktop.
0
Comment
Question by:sara2000
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 15

Expert Comment

by:Jaroslav Mraz
Comment Utility
There are usualy few problems.

1. Something bad in transer to cmd. There usualy help when you change extention from bat tu cmd

2. You are trying to do something withou coresponding user rights. Try to setu user with runing script admin no systemaccount.

3. Setup arguments in sheduler and work directory c:/myfile/

<competing site link removed - GaryC13>
0
 

Author Comment

by:sara2000
Comment Utility
it has admin user right.
0
 
LVL 15

Expert Comment

by:Jaroslav Mraz
Comment Utility
Ok

Then action is start a program


In program/script write only test.bat

And in optional start in write c:\myfile\
0
 
LVL 12

Expert Comment

by:ktaczala
Comment Utility
how did you add it to task manager?  through the GUI or from command line?
if from the GUI then the user that you created under must be logged in.
set it from the command line. (then it runs with administrative permission, no matter who is logged in or even if noone is logged in.)
cmd prompt with elevated privileges
c:\> at 22:00 /every:m,t,w,th,f c:\myfile\test.bat

here's a link for the command line formatting of the at command:
http://support.microsoft.com/kb/313565
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 53

Expert Comment

by:McKnife
Comment Utility
Sara, what makes you think it does not run?
Task Scheduler does not run programs interactively unless we set it up to "only run when the user is logged on" - if we don't select that, it will run, but invisible.
Could you make sure it does not run invisible?
0
 

Author Comment

by:sara2000
Comment Utility
McKnife:
Here is my simple bat file for snapdrive schedule. if the schedule runs then there should be an snapshot, I do not see the snapshot.
I know that comand runs when I am in comand prompt .

@echo off
sdcli snap create -s %computername%_%date:~4,2%_%date:~7,2%_%date:~12,2%_%time:~0,2%
0
 
LVL 15

Expert Comment

by:Jaroslav Mraz
Comment Utility
You shoud use quota "%computername%_%date:~4,2%_%date:~7,2%_%date:~12,2%_%time:~0"
0
 
LVL 53

Accepted Solution

by:
McKnife earned 500 total points
Comment Utility
Could it be it needs elevated rights? If so, try to check the box next to "run with highest privileges" in the task properties.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now