Jump to content
Sign in to follow this  
HockeyFan

Help creating Local Group and Users

Recommended Posts

HockeyFan

I'm sure I've totally screwed up the syntax, but can someone please help me!

I'm trying to write a scrtipt that creates a Local group on a Windows XP Pro system and then adds a user to that group. FYI...At the time this script runs, the PC is logged in as the administrator.

This is what I've got so far and it's not working:

Func AddLocalGroup()
$groupname = "Temp Group"
$user = "User1"
Run(@ComSpec & " /c " & 'Net Localgroup "' & $groupname & '"' & " /ADD", "", @SW_HIDE)
Run(@ComSpec & " /c " & 'Net localgroup "' & $groupname & '"' & " " & $user & " /ADD", "", @SW_HIDE)
EndFunc

Share this post


Link to post
Share on other sites
PsaltyDS

Works fine for me -- once I call the function.

You ARE calling the function, aren't you... :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
HockeyFan

Works fine for me -- once I call the function.

You ARE calling the function, aren't you... :)

Why yes... :)

Call("AddLocalGroup")

Share this post


Link to post
Share on other sites
HockeyFan

Why yes... :)

Call("AddLocalGroup")

OK...nevermind! :)

I tried it on a couple of other PC's and it worked fine. There must be something terrible wrong with my test PC. I'm wiping it clean!!! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×