Bypass UAC when Running .bat Files

I Found an excellent bit of code that addresses a serious problem for system administrators who wish to deploy unattended .bat files in Windows 7 and wanted to share it Here. UAC was introduced in order to improve security and make it more difficult for viruses or malicious software to hi-jack your command-line and do some serious damage. But in doing so, they made it a serious pain in the ass to accomplish certain administrative tasks that use to be common-place in previous versions of Windows.



The Code Below was not created by me, It is merely something that I thought deserved more exposure as it has proved invaluable in doing my job.
A sincere Thanks to Matt over @ for sharing this great piece of scripting.


  • Ok so im trying to understand… this script is supposed to bypass UAC, but it doesnt seem to be working for me as im still being prompted with UAC window when i run the script,,, any ideas why? Thanks

    • Tough to say without seeing your actual script – If you would like to post your details in the forums, I can take a look.

  • abir mohammed

    bro, it does not bypass UAC, it instead checks for Admin privilege….and prompts for admin access

Pin It on Pinterest