How-to Run TC as Administrator?
Moderators: Hacker, petermad, Stefan2, white
How-to Run TC as Administrator?
I know I can set up a TC shortcut and give it Administrative rights, but I also want to be able to set it up via command-line.
Is this possible?
Regards,
Chuck Billow
Is this possible?
Regards,
Chuck Billow
From the command line use:
powershell.exe -Command "Start-Process totalcmd.exe -Verb RunAs"
Provided that your system has PowerShell, of course.
powershell.exe -Command "Start-Process totalcmd.exe -Verb RunAs"
Provided that your system has PowerShell, of course.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Without PowerShell, you can also use Elevate, like this:
Or, if you disabled UAC and want to launch TC as different user:
Regards
Dalai
Code: Select all
elevate.exe c:\path\to\totalcmd.exe
Code: Select all
runas.exe /user:Administrator c:\path\to\totalcmd.exe
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
My Sudo tool also allows starting elevated processes.
Hmm, I haven't actively enabled scripts, so they must be enabled by default. So something in your system must have disabled them - maybe your anti-virus program.Peter, I get an error that running scripts has been disabled.
Here it works out-of-the-box under Windows 7, Windows 8.1 and Windows 10
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Try
Code: Select all
powershell.exe -ExecutionPolicy remotesigned -Command "Start-Process totalcmd.exe -Verb RunAs"
PowerShell: Set-ExecutionPolicy -ExecutionPolicy remotesign
The PowerShell execution policy is set to "Restricted" on default.petermad wrote:Hmm, I haven't actively enabled scripts, so they must be enabled by default. So something in your system must have disabled them - maybe your anti-virus program.Peter, I get an error that running scripts has been disabled.
Here it works out-of-the-box under Windows 7, Windows 8.1 and Windows 10
The Windows PowerShell execution policies are as follows:
"Restricted" is the default policy.
Restricted
- Default execution policy in Windows 8,
Windows Server 2012, and Windows 8.1.
- Permits individual commands, but will not run
scripts.
- Prevents running of all script files, including
formatting and configuration files (.ps1xml), module
script files (.psm1), and Windows PowerShell
profiles (.ps1).
https://technet.microsoft.com/en-us/us-en/library/hh847748.aspx
PS> help about_Execution_Policies
You have to modify the policy by executing "Set-ExecutionPolicy"
https://technet.microsoft.com/en-us/us-en/library/hh849812.aspx
PS> help Set-ExecutionPolicy
or by setting it explicitly on the command line as ZoSTeR shows:
PowerShell.exe -ExecutionPolicy xyz
https://msdn.microsoft.com/de-de/powershell/scripting/core-powershell/console/powershell.exe-command-line-help
PS> powershell.exe /?
Hi, petermadpetermad wrote:From the command line use:
powershell.exe -Command "Start-Process totalcmd.exe -Verb RunAs"
Provided that your system has PowerShell, of course.
Thank you for this suggestion. I've got Powershell, and this seems to work for me. I just don't totally get the syntax.
If I can paraphrase, this appears to basically be saying "start totalcmd.exe with the Verb RunAs". I would expect there to be an additional argument, for example "with the Verb RunAs Admin" My guess is that the reason that "Admin" is not explicitly stated is because Admin is the default argument of RunAs. Is that correct? I'm trying to understand how this starts Totalcmd.exe as user Admin, and I can't find the documentation for RunAs.
Thanks,
richardw, out-of-touch ex-programmer
Registered Total Commander user (and loyal supporter) since 1997