Force Batch File To Run As Admin (Working - 2024)
The problem was simple, infuriatingly so: the cleanup script—a humble cleanup_logs.bat —needed admin rights to delete the old system logs. But the scheduled task kept running it under the SYSTEM account with limited token privileges, and the junior admin who set it up was long gone.
Alan sipped his cold coffee. "The batch file… promoted itself." force batch file to run as admin
He opened the script again. This time, he added a scheduled task inside the batch file that ran itself as admin without prompting—the nuclear option. The problem was simple, infuriatingly so: the cleanup
Alan smiled. "This one could."
The screen flickered. A UAC box popped up: "Do you want to allow this app to make changes?" The problem was simple