Sign in to follow this  
Followers 0
Pook

Runas Function

3 posts in this topic

I guess I don’t understand how to use the RunAs command. I’m making a GUI that will let some of my Helpdesk users connect to a remote share using different credentials. (Users Home Drives on a Server)

The problem is that the ShellExecute command never uses the account information provided for it in the RunAs command.

Any ideas that I’m missing?? I just want the command to open the folder in an explore window.

Runas ("ACCOUNT", "Domain", "Password", 2, ShellExecute ("\\Domain\Share\Folder") )

Share this post


Link to post
Share on other sites



ShellExecute() is an Autoit3 Function, not a program to run with the new credentials.

Use @comSpec when you need the cmd.exe to run the target program/file.


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

That worked! Thanks

Runas ("ACCOUNT", "Domain", "Password", 2, (@ComSpec & " /c Explorer /root,\\Domain\Share\Folder") )

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