How to run command from command line as admin?
Moderators: white, Hacker, petermad, Stefan2
How to run command from command line as admin?
Maybe there is some kind of hotkey for this?
PS. I know about * in buttons, i need from command line directly.
PS. I know about * in buttons, i need from command line directly.
OS: Win10 | TC: latest x64
Re: How to run command from command line as admin?
Select "As Administrator" from the right click of your normal Cmd button.
There is no hotkey or anything else for this.
There is no hotkey or anything else for this.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3593)
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
Re: How to run command from command line as admin?
Ctrl+Shift+Enter (as in Win+R) would be nice.
Move the topic then to "TC suggestions".
Move the topic then to "TC suggestions".
OS: Win10 | TC: latest x64
Re: How to run command from command line as admin?
Support++.
I also want to have that * in the command line.
Thanks for making this suggestion.
I try to use it - really - every day... for example "*cmd" and it doesn't work...
It is simple and fast and perfectly to use, faster than every hotkey.
Hopefully simple to implement and perfect for adding it in Tc11.03rc05
Joube
Please Moderators: Move this threat to forum "suggestions". Thanks
Re: How to run command from command line as admin?
Workaround ...
I wrote SUDO.cmd that can help here. Using it daily without issues, but there might be some edge cases that I haven't run into (yet).
Start SUDO without parameters ans it will launch an elevated CDM prompt.
Start it with SUDO <your command> [options for your command], like sudo regedit -m and it will run that command elevated.
Put sudo.cmd somewhere where TC can find it.
SUDO.cmd
I wrote SUDO.cmd that can help here. Using it daily without issues, but there might be some edge cases that I haven't run into (yet).
Start SUDO without parameters ans it will launch an elevated CDM prompt.
Start it with SUDO <your command> [options for your command], like sudo regedit -m and it will run that command elevated.
Put sudo.cmd somewhere where TC can find it.
SUDO.cmd
Code: Select all
@echo off
:: Create dummy script
set RANDOM=>"%temp%\%~n0.ELEVATE"
:: File association: Run .ELEVATE always elevated
reg add HKCU\Software\Classes\.elevate /ve /D MaartenElevate /F >nul
reg add HKCU\Software\Classes\MaartenElevate\Shell\runas\command /ve /D "cmd.exe /c pushd \"%%w\" & start \"%~n0\" %%*" /F >nul
:: Execute dummy .ELEVATE script
"%temp%\%~n0.ELEVATE" %*
:: Clean up
rem reg delete HKCU\Software\Classes\.elevate /F >nul
rem reg delete HKCU\Software\Classes\MaartenElevate /F >nul
rem del /Q "%temp%\%~n0.ELEVATE"
Re: How to run command from command line as admin?
Ok, nice.
I use "elevate" elevate - Command-Line UAC Elevation Utility for things like this. *)
...but would prefere the TCs * at the Tc command line
Joube
*) and IsAdmin for already Admin checks and so on...
Re: How to run command from command line as admin?
Moderator message from: white » 2024-02-06, 00:19 UTC
Moved to Suggestions forum.
Re: How to run command from command line as admin?
Support++ for * also working in the command line
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: How to run command from command line as admin?
Completely off-topic:
AdminCheck.cmd
Code: Select all
@whoami /groups | findstr /i "S-1-16-16384 S-1-16-12288" >nul && echo YES || echo NO
But as said: workaround. Would be a good thing if this suggestion got implemented.
Re: How to run command from command line as admin?
Yes, also for everyone who is familiar with the command line and usually uses the command line. This is quicker, easier and more convenient than selecting a menu or a button or special hotkeys and so on.
Your suggestion++.
Joube