What I want to do is to create a scheduled task that has a author different than the current user.
Running this:
schtasks /create /SC MINUTE /MO 5 /TN test /TR "c:\test\test.bat" /U system /f
Gives me: "ERROR: Invalid syntax. Cannot specify user name without specifying system name."
To fix this, I used the /s switch fallowed by system name. Sadly, even giving the system name gives me a different problem:
schtasks /create /SC MINUTE /MO 5 /TN test /TR "c:\test\test.bat" /s computername /U system /f
Gives me: "ERROR: User credentials are not allowed on the local machine"
Is there a way around this? I've tried the switch /RU fallowed by the user name, but that only changes the user the scheduled task use to run, not the author) Also, is there a variable for the system name? (So that I don't have to know it/ change it each time for each different computer) Something like [/s %currentsystem%]
Edit: Subject changed from "system name"
ERROR: User credentials are not allowed on the local machine
Moderator: DosItHelp
Re: ERROR: User credentials are not allowed on the local mac
Useful variables are
%USERDOMAIN%
%USERNAME%
If you run CMD.EXE and issue command
SET
that will list all the variables that have been defined
Alan
%USERDOMAIN%
%USERNAME%
If you run CMD.EXE and issue command
SET
that will list all the variables that have been defined
Alan
Re: ERROR: User credentials are not allowed on the local mac
Thank you alan_b, that solved the variable trick
Now I just need to solve the other problem.
Now I just need to solve the other problem.
Re: ERROR: User credentials are not allowed on the local mac
Sounds like you have no rights to do this. Did you try to run as administrator? (type RUNAS /? to the command prompt)
Regards
aGerman
Regards
aGerman