Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SchTasks.exe to create a task folder

Is there a command to create a Schedule task folder in Windows 2008? I am trying to use SchTasks.exe to create the tasks and would like to put these tasks under a task folder. Essentially, inside task scheduler, add a new folder and add multiple tasks underneath the folder. From UI there is an option to create a folder but not sure about command reference

Thanks in advance

like image 316
G33kKahuna Avatar asked Mar 20 '12 21:03

G33kKahuna


People also ask

How do I create a folder in Task Scheduler?

From the Start menu, select Administrative Tools > Task Scheduler. Under Task Scheduler (Local), select Task Scheduler Library and choose New Folder from the Actions panel. Enter Datacap and click OK.

What does the Schtasks command do?

Schtasks.exe - Win32 appsEnables an administrator to create, delete, query, change, run, and end scheduled tasks on a local or remote computer.

How do I run Schtasks?

By default, the command runs with the permissions of the current user of the local computer. The specified user account must be a member of the Administrators group on the remote computer. The /u and /p parameters are valid only when you use /s. Specifies the password of the user account specified in the /u parameter.


1 Answers

few trials and solved the problem; the key is using "\" in the task name. Sample schtask.exe command line,

schtasks /create /xml "MyTask.xml" /tn "My Task Folder\My New Task"

creates a new task folder My Task Folder and creates a new task My New Task under the new folder

If the task needs to get created under an existing folder, try

schtasks /create /xml "MyTask.xml" /tn "Existing Task Folder\My New Task"

creates a new task My New Task under an existing task folder Existing Task Folder

like image 103
G33kKahuna Avatar answered Sep 28 '22 04:09

G33kKahuna