DemonAngel Posted April 12, 2006 Share Posted April 12, 2006 I have a problem with the following code. The problem exists within the command. ; Script Start - Add your code below here $username = IniRead("settings.ini","ACCOUNTS","username","") $password = IniRead("settings.ini","ACCOUNTS","password","") RunAsSet($username,@ComputerName,$password) $command = @SystemDir &"\net.exe localgroup power users /add " &@LogonDomain &"\" &@UserName Run($command) If I replace power users with administrators, it works fine. But because power users is 2 words it tries to add the user to the power group. If I run the command in a dos prompt I would only need to type "power users", but autoit reacts to "". How should I re-write this command so that it will work? Link to comment Share on other sites More sharing options...
jpm Posted April 12, 2006 Share Posted April 12, 2006 $command = @SystemDir &'\net.exe localgroup "power users" /add ' &@LogonDomain &"\" &@UserName Does that work? Link to comment Share on other sites More sharing options...
DemonAngel Posted April 12, 2006 Author Share Posted April 12, 2006 Perfect, Thanx jpm 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