Last active
May 15, 2024 17:10
-
-
Save Sopor/250e35d2bce15c14ca9e3fc679a410eb to your computer and use it in GitHub Desktop.
Total Commander - Open Command Prompt in current window as Administrator without showing that annoying UAC warning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SETLOCAL | |
if /i %1==scheduler goto SCHEDULER | |
echo %1 >%temp%\tcelevatedcmd.tmp | |
C:\Windows\System32\schtasks.exe /run /tn "RunStartCMD" | |
goto END | |
:SCHEDULER | |
set /P startcmdpath=<%TEMP%\tcelevatedcmd.tmp | |
c:\utils\nircmd\nircmdc.exe elevate %ComSpec% /K cd /d "%startcmdpath%" | |
if EXIST "%temp%\tcelevatedcmd.tmp" DEL "%temp%\tcelevatedcmd.tmp" | |
:END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download NirCmd and extract it to
c:\utils\nircmd
.In the above window click
Raw
and save it asRunStartCMD.cmd
inc:\utils
.Create a button in
Total Commander
that look like this or add it inusercmd.ini
(creating a button is much easier):Run
Task Scheduler
by openRun
(Winkey+R) and type intaskschd.msc
and pressENTER
.Navigate to
Task Scheduler
and expand it and right click onTask Scheduler Library
andCreate Task
:Type in a name, check
Run with highest privileges
,Hidden
and change toWindows 10
:Change to the tab
Action
and clickNew...
, type in the path to the batch file and typescheduler
as arguments:Change to the tab
Conditions
and set it as the picture shows:Change to the tab
Settings
and set it as the picture shows:Press
OK
to save it!You should now be able to open a command prompt window as Administrator in current directory without that annoying UAC warning...