How to run a .bat file as administrator from Windows Explorer?

\dir\test.bat must “run as administrator”

If I launch cmd.exe as administrator, change to \dir and type test.bat, test.bat runs correctly.

But if I use Windows Explorer to navigate to \dir, right-click on test.bat and choose “Run as administrator”, test.bat does not run correctly.

What must I do to run test.bat as administrator from Windows Explorer?

Thank you.

Create a shortcut to the .bat file then right click the shortcut and under the “shortcut” tab click the advanced button, you’ll see a checkbox “run as administrator”. You can then run the .bat from windows explorer as admin using the shortcut.

2 Likes

Thank you, tk11. Your suggestion worked.

1 Like