shornw Posted April 1, 2010 Share Posted April 1, 2010 I want to remove a group from the local administrators group. The problem I have is that the command line "net local group groupname /delete" doesn't work if there are more than about 20 characters in the groupname eg. "net local group testgroup /delete" will delete the group "net local group This-Is-A-Test-group-with-many-characters /delete" will NOT remove the group Is there anything within AutoIt that could do this, I cant find anything. Thanks for looking [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Juvigy Posted April 1, 2010 Share Posted April 1, 2010 try this: "net local group 'This-Is-A-Test-group-with-many-characters' /delete" Or try with WMI: Global $oLocalGroup = ObjGet("WinNT://" & @ComputerName & "/Power Users") $oLocalGroup.Add("WinNT://" & $sDomainName & "/" & $sGlobalGroup) If $f_COMError Then MsgBox(16, "Error", "Rats!") Else MsgBox(64, "Success", "Woohoo!") EndIf Link to comment Share on other sites More sharing options...
shornw Posted April 1, 2010 Author Share Posted April 1, 2010 Sorry... bad description. Post should read "net local group Administratots testuser /delete" will delete the group "net local group Administrators This-Is-A-Test-user-with-many-characters /delete" will NOT remove the group Juvigy -Thanks for this. I tried the "net local group 'This-Is-A-Test-group-with-many-characters' /delete" option before posting and it also doesn't work. It's a real pain and must be a bug as I can see no reason why there would be a character limit. [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
Juvigy Posted April 1, 2010 Share Posted April 1, 2010 Actually there is a character limit. Did you try the WMI solution? Just change ADD with Remove Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now