I've been trying to automate the creation of a user account with admin rights using cmd bat .

net localgroup administrators [I]account name[/I]/add

got the following error:

There is no such global user or group:[I]account name[/I]

what's the problem?

Recommended Answers

All 4 Replies

You may post solution in vbscript also(those who find batch obsolete).

Interesting. Maybe you left out the space between "name" and "/add"? Try this:

(
net user USERNAME PASSWORD /add
net localgroup administrators USERNAME /add
)

not working

Then you probably don't have permission to do this, in which case the only other alternative would be getting permission from the current admin, or hacking into it, which I cannot help you with.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.