This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tcmd F4 run notepad++ as administrator

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC suggestions (English) Printable version
View previous topic :: View next topic  
Author Message
lebede
Junior Member
Junior Member


Joined: 30 Apr 2013
Posts: 2

PostPosted: Tue Apr 30, 2013 6:41 am    Post subject: tcmd F4 run notepad++ as administrator Reply with quote

Hi, I want to run notepad++ as administrator by pressing F4 key (edit file), so I did:

1. notepad++.exe - properties - Compatibility- Privilege Level - Run this program as administrator

2. totalcomander - COnfiguration - Options - view and editing - set path for editor c:\prog\notepad++\notepad++.exe

But totalcommander write "File was not found. c:\prog\notepad++\notepad++.exe"

What can I do to run it??

Thanks!
Back to top
View user's profile Send private message
umbra
Power Member
Power Member


Joined: 14 Jan 2012
Posts: 760

PostPosted: Tue Apr 30, 2013 7:38 am    Post subject: Reply with quote

This looks more like an error and applies to applications that are set with "Comparetool=" or "Editor=" in wincmd.ini.

If they are configured to run with admin privileges and TC itself is not, the mentioned error occurs. But they work, if both TC and the tools have the same level of privileges - if both (or none of them) are running as admin.
_________________
Windows 7 Pro x64, Windows 8.1 Pro x64, Windows 10 Pro x64
Back to top
View user's profile Send private message Send e-mail
lebede
Junior Member
Junior Member


Joined: 30 Apr 2013
Posts: 2

PostPosted: Tue Apr 30, 2013 7:44 am    Post subject: Reply with quote

Exactly! Thats working!
Both run as administrator.
Thanks!
Back to top
View user's profile Send private message
umbra
Power Member
Power Member


Joined: 14 Jan 2012
Posts: 760

PostPosted: Tue Apr 30, 2013 8:00 am    Post subject: Reply with quote

I wouldn't call that a solution. At best it's a workaround. Anyway, glad to help.
_________________
Windows 7 Pro x64, Windows 8.1 Pro x64, Windows 10 Pro x64
Back to top
View user's profile Send private message Send e-mail
Horst.Epp
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 2596
Location: Germany

PostPosted: Tue Apr 30, 2013 8:11 am    Post subject: Reply with quote

lebede wrote:
Exactly! Thats working!
Both run as administrator.
Thanks!

Its useless to configure the editor to run as admin if TC is running as admin.
In this case the editor is running as admin automatically.
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7864
Location: Russian Federation

PostPosted: Tue Apr 30, 2013 11:14 am    Post subject: Reply with quote

lebede,
You can use my Sudo tool (link in signature, put it into TC dir), just enter following editor path:
Code:
"%COMMANDER_PATH%\Sudo.exe" "c:\prog\notepad++\notepad++.exe" "%1"

You don't need to set notepad's compatibility in such case.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34340
Location: Switzerland

PostPosted: Thu May 02, 2013 7:45 am    Post subject: Reply with quote

This doesn't work because TC uses WinExec to start the editor. Unfortunately WinExec does not support elevation, only ShellExecute(Ex) does.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Luzie
Junior Member
Junior Member


Joined: 27 Feb 2003
Posts: 86

PostPosted: Mon Jul 17, 2017 2:26 pm    Post subject: Reply with quote

ghisler(Author) wrote:
This doesn't work because TC uses WinExec to start the editor. Unfortunately WinExec does not support elevation, only ShellExecute(Ex) does.

Any solution to this one? I have the same problem if i want to use Editor=""%COMMANDER_PATH%\UTILITY\Crimson Editor Portable\cedt-286-portable\cedt.exe" "%1"" in WINCMD.INI
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7864
Location: Russian Federation

PostPosted: Tue Jul 18, 2017 2:01 am    Post subject: Reply with quote

Luzie,
Use my Sudo tool, it works in such case.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Luzie
Junior Member
Junior Member


Joined: 27 Feb 2003
Posts: 86

PostPosted: Tue Jul 18, 2017 3:21 pm    Post subject: Reply with quote

MVV wrote:
Luzie,
Use my Sudo tool, it works in such case.

Hi MVV,

thanks for your reply/suggestion. I tried your SUDO yesterday (before posting here) and today, but this not fixes my problem (or I made somehting wrong).

However I found a solution while testing:

I linked a Batch-File in WINCMD.INI with setting:
Code:
"Editor=""%COMMANDER_PATH%\BATCH\F4EDITOR.BAT" "%1""

and this F4EDITOR.BAT opens my Editor and File. F4EDITOR.BAT containing this Code:
Code:
"%COMMANDER_PATH%\UTILITY\Crimson Editor Portable\cedt-286-portable\cedt.exe" %1
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7864
Location: Russian Federation

PostPosted: Wed Jul 19, 2017 2:53 am    Post subject: Reply with quote

I've tried to set up administrator rights for an app and TC was able to start it via Sudo as an editor...
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Luzie
Junior Member
Junior Member


Joined: 27 Feb 2003
Posts: 86

PostPosted: Wed Jul 19, 2017 9:21 am    Post subject: Reply with quote

MVV wrote:
I've tried to set up administrator rights for an app and TC was able to start it via Sudo as an editor...

OK. My problem was the other way round: I start TC as Admin and then starting Editor with F4 works. But when I start TC without Adminrights, then Editor via F4 don´t work and it raises only Error-Message for wrong link. With the way I discovered yesterday (starting Editor from Batch) it work with and without Admin-Rights.
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 7864
Location: Russian Federation

PostPosted: Wed Jul 19, 2017 9:25 am    Post subject: Reply with quote

That's strange because Sudo works fine for me when I start TC w/o admin rights.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
DrShark
Power Member
Power Member


Joined: 03 Nov 2006
Posts: 917
Location: Kyiv, 68/262

PostPosted: Thu Jul 27, 2017 8:32 am    Post subject: Reply with quote

Luzie wrote:
ghisler(Author) wrote:
This doesn't work because TC uses WinExec to start the editor. Unfortunately WinExec does not support elevation...
... I have the same problem if i want to use Editor=""%COMMANDER_PATH%\UTILITY\Crimson Editor Portable\cedt-286-portable\cedt.exe" "%1"" in WINCMD.INI

Luzie wrote:
... I found a solution while testing:
...
and this F4EDITOR.BAT opens my Editor and File.
There's no need for a separate .bat file if cmd.exe is used to start the editor:
http://ghisler.ch/board/viewtopic.php?p=328408#328408

MVV wrote:
You can use my Sudo tool (link in signature, put it into TC dir), just enter following editor path:
Code:
"%COMMANDER_PATH%\Sudo.exe" "c:\prog\notepad++\notepad++.exe" "%1"
Since Sudo doesn't have the documentation, I suggest to add similar example of Sudo usage either to program's Totalcmd.net page or as a built-in help shown after calling the sudo with /? or -help parameter.
_________________
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC suggestions (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group