Sign in to follow this  
Followers 0
littlewack

Help: Script to run any app as domain admin

2 posts in this topic

So im trying to create a little application to aid me when needing to run a program on a restricted users workstation, But im having a little trouble. I would like it to prompt for the admin password, And then prompt for what program to run.

The below script seems to work OK, But I need it to do more and im not sure where to go from here.

For instance it doesnt return any info if you enter the incorrect password for the administrator.

Could someone give me some insight on how to make this better? OR possibly if someone knows of a script thats out there that does what I need?

Thanks!!!!!!!!!!!!

Local $sUserName = "Administrator"
Local $sPassword = InputBox("Enter password", "Enter Administrator Password", "", "!", 200, 150)
Local $sProgram = FileSelectFolder("Select program to run?", "","4")


Local $pid = RunAsWait($sUserName, @logonDomain, $sPassword, 0, $sProgram)
; Wait for the process to close.
ProcessWaitClose($pid)

MsgBox(0, "", "The program has closed.")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

"For instance it doesnt return any info if you enter the incorrect password for the administrator. "

Maybe thats because you are trying to Run() a folder.

Try FileOpenDialogue()

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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