Microsoft
Software
Hardware
Network
Question : How do I create scheduled tasks from the command line in Windows 2008?
I have a script that worked in Windows 2003 which added scheduled tasks from the command line. But these scripts won't work in Windows 2008, I guess because the task engine is pretty different. This is what my W2K3 script looks like (ScheduleTask.cmd):
@ECHO OFF
SETLOCAL
rem --------------------------
----------
----------
--
rem --------------- GLOBAL VARIABLES ---------------
rem --------------------------
----------
----------
--
SET SCRIPTPATH=%1
SET SCRIPTNAME=%2
SET TASKFREQUENCY=%3
SET TASKTIME=%4
rem --------------------------
----------
----------
--
rem ----------------- SCHEDULE TASK ----------------
rem --------------------------
----------
----------
--
SCHTASKS /CREATE /SC %TASKFREQUENCY% /ST %TASKTIME% /TN %SCRIPTNAME% /TR %SCRIPTPATH% /RU "NT AUTHORITY\SYSTEM"
And then I would just call the script like this from another script:
SET SCRIPTPATH="D:\scripts\DoS
omething.c
md"
SET SCRIPTNAME=Task_Test_1
SET TASKSCHED=D:\ScheduleTask.
cmd
SET TASKFREQUENCY=DAILY
SET TASKTIME=00:30:00
CALL %TASKSCHED% %SCRIPTPATH% %SCRIPTNAME% %TASKFREQUENCY% %TASKTIME%
Can anyone help with converting my script so it works for Windows 2008?
Answer : How do I create scheduled tasks from the command line in Windows 2008?
Also I'd say going by SirBounty's comments here
http://www.experts-exchang
e.com/Prog
ramming/La
nguages/
Sc
ripting/Sh
ell/Batch/
Q_23585198
.html
just try using just /ru system
Terry
Random Solutions
Your message has been successfully relayed to the following recipients....
mysql remote server replication
Subreport could not be shown - SQL Server Reporting Services 2008 - Only on delpoyed Reports via Report Veiwer Web Part - SharePoint Integrated Mode Setup
SQL Query
Backup Exec - Exchange 2007 / Poor Performance and Eventual Exhaustion of RAM Backing up Information Store
IMAP Verizon client can't send email through SMTP virtual server
Compress FAT32 drive
Can WebDAV be configured with Anonymous access under IIS 7.0?
How can I refresh ODBC Table Links using Access Code?
Getting Red Alert 2 game to work on my Win XP PC