Jump to content

open script with different account


Recommended Posts

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
Link to comment
Share on other sites

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

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

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
 Share

  • Recently Browsing   0 members

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