legend Posted March 4, 2019 Share Posted March 4, 2019 Hello, I need to somehow trigger the runas function without providing any username or password, I let UAC about that, so I need the user to enter the username and password. Run as administrator will trigger the UAC login box, but I can't use that one, because I need to run the script with a domain administrator on startup. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 4, 2019 Share Posted March 4, 2019 @legend InputBox(es) or a simple GUI in which the user set username and password should do the trick Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
legend Posted March 4, 2019 Author Share Posted March 4, 2019 1 hour ago, FrancescoDiMuro said: @legend InputBox(es) or a simple GUI in which the user set username and password should do the trick that would work, but if it's possible to use the UAC login prompt, that would be better, using a inputbox feels a bit wrong, sort of untrustworthy Link to comment Share on other sites More sharing options...
Nine Posted March 4, 2019 Share Posted March 4, 2019 Do a screen capture of the UAC, post it in a GUI, place 2 input box over. Voilà ! FrancescoDiMuro 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
AdamUL Posted March 8, 2019 Share Posted March 8, 2019 You can force Windows to display a UAC prompt for a process, if the user does not have the Admin Token, by using the "runas" verb in the ShellExecute or ShellExecuteWait functions. There are examples on the forum using this technique. If you want to go the dialog route. Have a look at _WinAPI_ShellUserAuthenticationDlg or _WinAPI_ShellUserAuthenticationDlgEx, for a proper authentication dialog box. You could then use the credentials in the RunAs command. Adam 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