ERROR: User credentials are not allowed on the local machine

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Phail
Posts: 2
Joined: 15 Jul 2010 00:43

ERROR: User credentials are not allowed on the local machine

#1 Post by Phail » 15 Jul 2010 01:34

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"

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: ERROR: User credentials are not allowed on the local mac

#2 Post by alan_b » 15 Jul 2010 02:24

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

Phail
Posts: 2
Joined: 15 Jul 2010 00:43

Re: ERROR: User credentials are not allowed on the local mac

#3 Post by Phail » 15 Jul 2010 03:51

Thank you alan_b, that solved the variable trick :)

Now I just need to solve the other problem.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: ERROR: User credentials are not allowed on the local mac

#4 Post by aGerman » 15 Jul 2010 05:50

Sounds like you have no rights to do this. Did you try to run as administrator? (type RUNAS /? to the command prompt)

Regards
aGerman

Post Reply