Windows – network path not found error on creating schtasks

scheduled-taskswindows xp

I am getting "ERROR: Network path was not found" when I try to create a scheduled task on my local machine.
I am using this command at the command prompt: schtasks /tn taskname /tr taskpath /sc minute /mo 20 /sd 09/23/2010 /s \\%computername% /u username /p password

When I give the above command without computername, username and password the task gets created perfectly fine. What am I doing wrong??

EDIT : I got it working by using the below command. I do not understand why it is working becuase I am using /ru and /rp which are remote user and remote password settings whereas I am executing the command on my local machine. And I had to give double quotes to computername.

schtasks /tn taskname /tr taskpath /sc minute /mo 20 /sd 09/23/2010 /s "%computername%" /ru username /rp password

Best Answer

I believe if you are trying to run that command as written, the target machine %computername% will alway return your local machine name. By default schtasks works locally, unless you specify a remote machine with /s.

Now, if the command you are running is /s remotemachine, and you get that error, I believe the \\ is not necessary. Here are some examples.

Hope this helps.