hendrikhe Posted May 3, 2017 Share Posted May 3, 2017 (edited) Hello, If I open an autoit script with a different account (Windows 7, Hold Shift-:right mouse: Run as different user), the values from @Username @MyDocumentsDir change according with the user that is running it. I would like to keep @Username @MyDocumentsDir from the user that is currently logged on this desktop I just Need the admin rights of this "different user" and the values of the normal user Edited May 3, 2017 by hendrikhe Link to comment Share on other sites More sharing options...
hendrikhe Posted May 10, 2017 Author Share Posted May 10, 2017 (edited) friendly bump Edited May 10, 2017 by hendrikhe Link to comment Share on other sites More sharing options...
Floops Posted May 10, 2017 Share Posted May 10, 2017 You could split your script into two. The first passes the variables as parameters to the second one and the second one requires admin rights. If you want to do it that way search for $CmdLine Link to comment Share on other sites More sharing options...
AdamUL Posted May 10, 2017 Share Posted May 10, 2017 Here is an example that should help you with what you want to do. Adam Link to comment Share on other sites More sharing options...
benched42 Posted May 10, 2017 Share Posted May 10, 2017 One thing you could do is to run one script to get the @Username and @MyDocumentsDir from the system and then pass them as variables to a second script that you launch from within the first. Who lied and told you life would EVER be fair? 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