Jump to content

Recommended Posts

Posted

From the helpfile.

Runwait.

Return Value

Success: Returns the exit code of the program that was run.

Failure: Depends on RunErrorsFatal; see Remarks.

  • Developers
Posted (edited)

You aren't getting -1 as returncode with the posted code since it contains syntax errors, unless you compile it first and then run it.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Nvm, my bad. I didn't looked close enough.

RunWait(@ComSpec & " /c " & "net localgroup power users mydomain\" & $username & " /add",@WorkingDir, @SW_SHOW)

Posted

Nvm, my bad. I didn't looked close enough.

RunWait(@ComSpec & " /c " & "net localgroup power users mydomain\" & $username & " /add",@WorkingDir, @SW_SHOW)

Thanks for the response. Still didn't work, I got a return code 2 this time.

  • Developers
Posted

Thanks for the response. Still didn't work, I got a return code 2 this time.

Did you try the command from the CMD prompt first to see if its valid?

Pretty sure you will get an error :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Did you try the command from the CMD prompt first to see if its valid?

Pretty sure you will get an error :)

I did try it and the command works fine from a command prompt on the workstation. It successfully completes and when I go into the Power Users Group I see the user in there. I can delete the user from the group and run from a command line and it will readd it. If I try to run it from the AutoIt script I get the error 2 and no user is added to the group.

Thanks

  • Developers
Posted

I did try it and the command works fine from a command prompt on the workstation. It successfully completes and when I go into the Power Users Group I see the user in there. I can delete the user from the group and run from a command line and it will readd it. If I try to run it from the AutoIt script I get the error 2 and no user is added to the group.

Thanks

It works for you without putting the groupname Power Users in double quotes?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

It works for you without putting the groupname Power Users in double quotes?

The command I'm running on the workstation is net localgroup "power users" domain\user /add

I'm not sure the syntaxt for this when put into the autoit code line. The options I've tried cause an error

  • Developers
Posted (edited)

The command I'm running on the workstation is net localgroup "power users" domain\user /add

I'm not sure the syntaxt for this when put into the autoit code line. The options I've tried cause an error

That is what I ment, you cannot just leave the double quotes, else the command line is not the same.

Should be something like:

RunWait(@ComSpec & ' /c net localgroup "power users" mydomain\' & $username & ' /add',@WorkingDir, @SW_SHOW)
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

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