littlewack Posted February 3, 2011 Share Posted February 3, 2011 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.") Link to comment Share on other sites More sharing options...
JohnOne Posted February 3, 2011 Share Posted February 3, 2011 (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 February 3, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now