Jump to content

Command Problem


Recommended Posts

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...