0

So, I am making little program to login in program. Everytime when I want to start program, UAC pop up for login. I have the username and password. So I want to make program that automatically type username and password and press enter.

I made the program with Vbscript. But it's not Working. Here is the code for Vbscript:

Set cam = WScript.CreateObject( "WScript.Shell" )
cam.Run("""path\.exe""")
wscript.sleep 3000

cam.sendkeys "username"
cam.sendkeys "{TAB}"
cam.sendkeys "password"

cam.sendkeys "{TAB}"
wscript.sleep 100
cam.sendkeys "{TAB}"
cam.sendkeys "{ENTER}"

Program start, but won't type anything. When I try to open like notepad

cam.Run("""C:\WINDOWS\system32\notepad.exe""")

Notepad open, and program automatically type username, and password. Problem is, Why UAC doesn't let my program to type in to him? And how to fix that.

Sorry for my bad english, I tried to explain as best I could. Thank you

Tapex
  • 1
  • 1
  • Possible duplicate of [Bypass UAC in VbScript](http://stackoverflow.com/questions/5344021/bypass-uac-in-vbscript) – Ben Mar 06 '17 at 10:14
  • Sorry, no. You cannot bypass the UAC prompt, and this is by design. (If it were possible, then this is all malware would have to do to infect your system.) – Bill_Stewart Mar 06 '17 at 17:42
  • But I am not trying to bypass UAC prompt. I have username and password for UAC, I just want automatically log in to UAC with simple script. – Tapex Mar 06 '17 at 17:54
  • You cannot automatically elevate. – Bill_Stewart Mar 07 '17 at 05:46

0 Answers0