Jump to content

Recommended Posts

Posted

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.")

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
×
×
  • Create New...