MarcWWS

RunAs

14 posts in this topic

#1 ·  Posted (edited)

Hello,

i've just downloaded AutoIT because i have to handle a problem. I got a user in my domain who has to start a unlocker for the WD My Passport (encrypted external HDD). The Unlocker path is "O:WD Drive Unlock.exe", this one needs admin rights.

Edit: The Drive "O" is an simulated CD-Drive but i think it doesnt botther.

I've just wrote this code but doesnt work for me :

RunAs ("install",@ComputerName,"installPassword",1, "WD Drive Unlock.exe","O:\")
Edited by MarcWWS

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

"install" is a local or a domain user?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

"install" is a local and a domain user. but when i execute the .exe i says domain authentification

RunAs ("install","wiwe.local","installPassword",1, "WD Drive Unlock.exe","O:\")

doesnt work,too.

RunAs ("install","wiwe.local","installPassword",1, "notepad.exe","")

This with the notepad work, did it just to test it.

Edited by MarcWWS

Share this post


Link to post
Share on other sites

Any help ? :

Share this post


Link to post
Share on other sites

Is "WD Drive Unlock.exe" located on o: as well?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yes, the .exe is directly under o: . I've also tested it now with a other Programm(code below) which is on my HDD, doesnt work as well too.

RunAs ("install",@ComputerName,"installPassword",1, "ACMPConsole.exe","C:\Program Files (x86)\Aagon\ACMP Console\Bin")

Share this post


Link to post
Share on other sites

You have to specify the full path:

RunAs ("install","wiwe.local","installPassword",1, "O:\WD Drive Unlock.exe","O:\")

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

 

You have to specify the full path:

RunAs ("install","wiwe.local","installPassword",1, "O:\WD Drive Unlock.exe","O:\")

for some reason it wont work..

Share this post


Link to post
Share on other sites

Should it work at all , because the HDD pretends to be a CD drive? And with the domain Login there should be no problem, too ?

Share this post


Link to post
Share on other sites

No1 got an idea for this "easy" script ? :ermm:

Share this post


Link to post
Share on other sites

The Pop-up ask me if im sure that the programm can make changes and need Administration privilleges of the domain. (tested with an normal user)

Share this post


Link to post
Share on other sites

OK, the UAC is enabled : RunAs will execute the program with admin rights (if "install" is an admin account) but won't elevate the privileges. So you can't skip the UAC prompt easily.

You have to use #RequireAdmin at the top of you code.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Now it executes the programm. But i thaught i can write this that a normal user without admin can execute the Programm. In my company not every one got admin rights. So i thaught i can write this programm that every customer (without admin rights) can use the external HDD.

Atm i got this :

#RequireAdmin
RunAs ("install","wiwe","installPassword",2,"O:\WD Drive Unlock.exe","O:\")

When i run this with the normal user it ask me to enter Admin user but after entering it the Unlock.exe starts. What i need is that i dont need to enter admin.

Edit: I wrote a 2nd script now that executes this script and this works :geek:  i dont know why and if this is the right way but till it works its fine..

Edited by MarcWWS

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