Sign in to follow this  
Followers 0
Agent Orange

Passing parameters in the Run command

5 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thank you! sometimes you look at something so long you miss the obvious :lmao:

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

SetInfo needs parameters if it is a function, or at least parenthesis. Or it needs to be read or set, if it is a property.

Share this post


Link to post
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
Sign in to follow this  
Followers 0