Skip to main content


Is there some kind of trick to restarting NVDA programmatically? If I try to just task schedule or python subprocess c:\program files (x86)\nvda\nvda.exe I get "Requires elevation" errors even when running as privileged user. How does this work? @NVAccess #nvda
in reply to Florian

NVDA has the uiAccess privilege to enable access to the UI of apps running as admin. This requires a special kind of elevation. The easiest way to get that elevation is to use ShellExecute, which will verify that the app is in an allowed location for uiAccess apps and then elevate accordingly.
in reply to Jamie Teh

Python:
import ctypes; ctypes.windll.shell32.ShellExecuteW(None, None, r"c:\Program Files (x86)\nvda\nvda.exe", "", None, 1)
in reply to Jamie Teh

@jcsteh Ah Jamie has you sorted, ignore my earlier reply which is out of date :)
in reply to Jamie Teh

@jcsteh Thanks! :) I was noodling with it a bit more and noticed that supplying shell=True to subprocess also seems to work although using that is discouraged for security reasons, which is amusing :) I'll use this for now, thanks much