Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Scheduled task "run as" problem

Jul 27, 2007 3:40AM PDT

I have a batch file that runs on clients to create a scheduled task to defrag, so it is set to create with credentials for running under the admin account. this used to work fine, and recently started to create tasks for the users under their account, and will not take the Run As information in the command line. Here is the syntax I am using:

SCHTASKS /CREATE /SC WEEKLY /D SUN /TN Admin-defrag /TR \\server\shared\Defrag\admin-defrag.bat /ST 01:00:00 /SD 01/01/2007 /RU domain\administrator /RP password

Discussion is locked