How to give a script elevated rights without UAC prompt - "Program, close", Task Manager etc

Put simple Tips and Tricks that are not entire Tutorials in this forum
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

How to give a script elevated rights without UAC prompt - "Program, close", Task Manager etc

Post by Noo0B » 12 Aug 2022, 22:27

Hi,
If you need elevated rights for a code, for example a Task Manager code or a "program, close" line of code and also would like to remove the UAC prompt, you can use this Scheduled Tasks tool I found:
https://drive.google.com/file/d/1JsNUp5GDAjJSGHbarAZUo4y2_nzYGWL6/view?usp=sharing from this webpage :https://www.tenforums.com/tutorials/57690-create-elevated-shortcut-without-uac-prompt-windows-10-a.html. I believe there is another post on the same website with the same solution.
To use this, name whatever you want on it's first input for the shortcut it creates and it will link to the file specified next. After finished, the shortcut can then be moved, but not renamed. To delete this, go to Scheduled Tasks app and proceed, and also delete the shortcut.
If you just want the elevated rights you can use this:

Code: Select all

if not A_IsAdmin
	Run *RunAs "%A_AhkPath%" "%A_ScriptFullPath%"
I hope it helps.
Regards.

ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: How to give a script elevated rights without UAC prompt - "Program, close", Task Manager etc

Post by ozzii » 13 Aug 2022, 02:48

Didn't know for that bat.
Thanks

Post Reply

Return to “Tips and Tricks (v1)”