can i run a cmd file as admin always ?

Twila

Reputable
Sep 3, 2015
7
0
4,510
first off i know nothing about cmd's.scripts ..etc
what i want i to be able to do is instantly kill windows magnifier with a single key bound to my keyboard.
i found a script file (cmd) to kill a certain file online and i edited it to point to magnify.exe and renamed to kill mag.cmd

the file does as i want but i always have to right click and select run as admin from context menu.
i cant find a way to set this as run as admin permanently so i can bind to my keyboard.
i tried renaming the file to ahk and using auto hotkey but it dosent recognize the commands.

is there any other option to make this file always run as admin ?
is the only way to make this run always as admin is to make cmd.exe always run as admin ?
is there reason i shouldnt make cmd.exe always admin ?
anybody want to help turn this into a working ahk file ?

files contents =

REM Kill all instances of magnify.exe
: again
REM Check for instances of magnify, then kill them
tasklist /FI "IMAGENAME eq magnify.exe" | find /I /N "magnify"
if "%ERRORLEVEL%"=="0" taskkill /f /im magnify.exe
TIME /T
REM Set timeout interval in seconds
timeout /t 180 >nul
GOTO again

thanks



 
thanks for your reply

both taskkill /IM magnify.exe and the above works but only if i right click and select run as administrator.

if i dont do that then they dont work .

i have UAC turn off always.

i want to be able to bind the cmd file to a key on kb or on my mouse to run with a single click.

i can bind it the way it is but it dosent work unless i right click and select run as administrator every time i run it .thats the step im trying to bypass
so it will work correctly with a single click bound to a button.

on a normal file i can rclick then go to properties then compatibility and put a check mark on run as admin ,but this option isnt there for a *.cmd file

im thinking theres a way to do this via autohotkey script ,but i dont have any experience at writing a script file(.ahk)