Sign in to follow this  
Followers 0
hendrikhe

open script with different account

5 posts in this topic

#1 ·  Posted (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 by hendrikhe

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

friendly bump

Edited by hendrikhe

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

Share this post


Link to post
Share on other sites

#4 ·  Posted

Here is an example that should help you with what you want to do.  

Adam

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

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?

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