Edit file with administrative privilages

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
lluke777
Junior Member
Junior Member
Posts: 11
Joined: 2018-01-30, 11:38 UTC

Edit file with administrative privilages

Post by *lluke777 »

I have editor at Configuration->Edit/View set as follows:

Code: Select all

 c:\vim\vim74\gvim.exe "%1"
how to open file with administrative privilages for example:

Code: Select all

c:\Windows\System32\drivers\etc\hosts
?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Make abutton with a * in front of the program:
*c:\vim\vim74\gvim.exe
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
lluke777
Junior Member
Junior Member
Posts: 11
Joined: 2018-01-30, 11:38 UTC

Post by *lluke777 »

Horst.Epp wrote:Make abutton with a * in front of the program:
*c:\vim\vim74\gvim.exe
File not found!
*c:\vim\vim74\gvim.exe
"The system cannot find the file specified

What to do with that?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

lluke777 wrote:
Horst.Epp wrote:Make abutton with a * in front of the program:
*c:\vim\vim74\gvim.exe
File not found!
*c:\vim\vim74\gvim.exe
"The system cannot find the file specified

What to do with that?
That is a standard function of TC and works regardless of the program to start.
It works on a button or in an em_command
and there is an UAC question of course on every start.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2lluke777
You have to add the * prefix to the file in the button or TC's start menu, NOT to the editor command which I guess you've done.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2lluke777

Button:

Code: Select all

TOTALCMD#BAR#DATA
*c:\vim\vim74\gvim.exe
%P%N
c:\vim\vim74\gvim.exe
Edit with gvim - as Administrator


-1
To make the button:
1. Mark the green text above (including TOTALCMD#BAR#DATA in the first line and -1 in the last line).
2. Copy it to the ClipBoard (Ctri+C).
3. Right click on TC's buttonbar and choose "Paste".
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
lluke777
Junior Member
Junior Member
Posts: 11
Joined: 2018-01-30, 11:38 UTC

Post by *lluke777 »

petermad wrote:2lluke777

Button:

Code: Select all

TOTALCMD#BAR#DATA
*c:\vim\vim74\gvim.exe
%P%N
c:\vim\vim74\gvim.exe
Edit with gvim - as Administrator


-1
To make the button:
1. Mark the green text above (including TOTALCMD#BAR#DATA in the first line and -1 in the last line).
2. Copy it to the ClipBoard (Ctri+C).
3. Right click on TC's buttonbar and choose "Paste".
Works fine.Thank you :)

I assume the parameters %P%N take selected file. What they mean exactly?
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

What they mean exactly
Open the button for editing (right click - Change) and press F1
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply