need to to add scheduled task in c#

i have following code that does not work in xp.
i tested with other commands such as chkdsk,  it worked, but when using schtasks it dose not work again.
can someone please help?
string command="schtasks /create /sc once /tn restart /tr \"c:\\windows\\system32\\shutdown.exe -r -t 60\" /st 11:20 /ru system";

            System.Diagnostics.ProcessStartInfo psinfo;

            System.Diagnostics.Process pro = new System.Diagnostics.Process();

            psinfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c "+command);

            pro.StartInfo = psinfo;

Open in new window

Who is Participating?
IkelcaConnect With a Mentor Author Commented:
ok found whats wrong,
the time has to be hh:mm:ss
IkelcaAuthor Commented:
found solution myself
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.