Jump to content

Recommended Posts

Posted (edited)

I'm attempting to use my main program to call another autoit exe using the run command and passing 3 parameters to it. I'm having an issue getting the Run command to work. I'm trying to use the RunAsSet command to run the second .exe with elevated rights. Is it possible to do this? Below is the code for the main program and the second program.

;here's part of the main program....
Func _changepswd()
If Not @error Then
RunAsSet("username", "Domain", "pswd")
Run("c:\changer.exe " & GUICtrlRead($UserString) & (GUICtrlRead($currentpassword) & GUICtrlRead($newpassword)) ;it is dying here with a parse error....
RunAsSet()
EndIf
Msgbox(0,"Status","Password Change Was Successful. Click Ok to Exit")
DriveMapDel("\\server\share")
Exit(0)
EndFunc
oÝ÷ Øw«z+-ç(uçè®Ø^r§êé®+jf®¶­s`¢b33c´FöÖå7G&ærÒgV÷C¶BFöÖâgV÷C°¢b33cµW6W$ö&¢Òö&¤vWBgV÷CµväåC¢òògV÷C²fײb33c´FöÖå7G&ærfײgV÷C²ògV÷C²fײb33c´6ÖFÆæU³Ò¢b33cµW6W$ö&¢ä6ævU77v÷&Bb33c´6ÖFÆæU³%ÒÂb33c´6ÖFÆæU³5Ò¢b33cµW6W$ö&¢å6WDæfð¤W@

what do you think?

Edited by Agent Orange
  • Developers
Posted

Looks like a Brace to many:

Run("c:\changer.exe " & GUICtrlRead($UserString) & (GUICtrlRead($currentpassword) & GUICtrlRead($newpassword))

Don't you need spaces between the parameters"?

Run("c:\changer.exe " & GUICtrlRead($UserString) & " " & GUICtrlRead($currentpassword) & " " & GUICtrlRead($newpassword))

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

Ok. I got the password change to work...however I'm getting an error I can't figure out at the end.

Here the code for the main program:

If Not @error Then
RunAsSet("user", "domain", "pswd")
Run("c:\changer.exe " & GUICtrlRead($UserString) & " " & GUICtrlRead($currentpassword) & " " & GUICtrlRead($newpassword)) 
RunAsSet()
EndIf
Msgbox(0,"Status","Password Change Was Successful. Click Ok to Exit")
Exit(0)

Any ideas?

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...