You cannot bypass the UAC prompt

We get a question like this at least once per week:

How can I bypass the UAC prompt when running a program or a script?

The answer to this question is that you cannot bypass the UAC prompt, and this is by design.

Please read the following FAQ for the reasons why:

FAQ: Why can't I bypass the UAC prompt?

The only way to run a program that requires administrative access (elevation) is to use Run as administrator (either by right-clicking or or the shell runas verb in a script). You can also schedule the program to run with highest privileges, but doing so requires administrative permissions already and thus does not constitute bypassing the UAC prompt.

The runas command starts a program with alternate credentials, but the program is not started as administrator (elevated). In other words, you cannot use the runas command to bypass the UAC prompt either.

Disabling UAC is not recommended for the reasons stated in th

December 29th, 2014 7:03pm

If the command you want to run is something simple you can you psexec to run as a local admin on the machine. It would look something like this: Psexec \\hostnameorip cmd -s

I believe you can run a ps script in cmd with: 

powershell -noexit "& ""C:\my_path\yada_yada\run_import_script.ps1""" 

Might not get the same response but its a start. This worked for me when I ran a simple PS script to check for Windows updates and export to file on a DC.

Free Windows Admin Tool Kit Click here and download it now
April 15th, 2015 1:52pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics