UAC errorlevel question

Get help with using AutoHotkey and its commands and hotkeys
sttrebo
Posts: 66
Joined: 27 Jan 2014, 12:31

UAC errorlevel question

03 Oct 2019, 09:40

I have a small script that runs on boot up:

Code: Select all

Sleep, 1000
run *RunAs "C:\Program Files (x86)\johnsadventures.com\John's Background Switcher\BackgroundSwitcher.exe"
Sleep, 3000

SetTimer, Johns, 900000
return

Johns:
	process, exist, BackgroundSwitcher.exe
	If !(ErrorLevel) {
		Sleep, 1000
		run *RunAs "C:\Program Files (x86)\johnsadventures.com\John's Background Switcher\BackgroundSwitcher.exe"
		Sleep, 3000
	}
return
one thing though is if I am not at my desk and the UAC dialog times out, it causes an error in this script. Since i'm not real familiar with UAC, I was hoping someone could help me with fixing or adding in the correct error conditions that would prevent the timeout from causing a problem. or if it's even possible. I did play around with the "RunAsTask" script to bypass this problem, but I haven't got it to work acceptably either.

thanks in advance.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], scriptor2016, songdg and 35 guests