Run As administrator

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

2JimmyTheBroker
You could try a clean wincmd.ini:
1. Type %COMMANDER_PATH%\totalcmd.exe /i="%temp%\fresh.ini" in the TC command line <ENTER>
2. Make again an em_command (the button is already there!)
3. Afterwords - before another test - you should delete fresh.ini so that the test result is not falsified
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

tuska wrote:2JimmyTheBroker
Hmm, after clicking on the button I get a 1:1 copy of the current TC instance
-> with all active and inactive tabs in the new TC instance with admin rights.

The button has been quoted several times here in the forum - the problem will probably not be in the parameters to the button.
There must be something else (some setting in wincmd.ini?) - unfortunately I do not know why the button does not work for you.
The button alone can't provide a copy of all open tabes into the new instance
as it only gives the new instance the path of the file on the left side
and the path to the target dir on the right side as parameters.
TC will only open all other tabs if its set to save/restore all tabs on exit/start.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2JimmyTheBroker
To make the Tabs turn up as in the current instance of TC in the new instance of TC the settings have to be saved before restarting the new instance.

Try this:
Put this in your usercmd.ini file:

Code: Select all

[em_newcommander]
cmd=*%COMMANDER_EXE% /N
Make this button:

Code: Select all

TOTALCMD#BAR#DATA
cm_ConfigSaveSettings,em_newcommander,cm_Exit

%COMMANDER_EXE%
Open as Administrator with saved settings


-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".
The disadvantage of this is that all changes you have made in TC will be saved. If you always have all four options in "Configuration" -> "Options" -> "Operation" -> "Save on exit" enabled, you will not feel any difference though. But if you have disabled saving of for example Directories and/or Panels, I cannot recommend using this button, if you don't want those things saved.

Since the settings are saved, you don't need to use the param=%Z%X %P %T - this was only to restart TC in the same directories as the current ones - but when they are saved to wincmd.ini with the cm_ConfigSaveSettings command there is no need for that anymore.
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
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

Hmmm,

Whenever I close TC and re-open it (use the red cross in the top right hand corner), it always re-opens to the original tabs.

"Configuration -> Options -> Operation -> Save on Exit -> Directories"
Save on exit:
Directories[ticked]
Panels (brief/full, etc.)[ticked]
Old command lines[ticked]
Directory history[ticked]
I finally get notifications from emails again!!!
So happy!
User avatar
JimmyTheBroker
Member
Member
Posts: 179
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker »

I think is a bit circular.. I cant save the tab directories because I don't have the write permissions, but I need the write permissions to save the tab directories...


I generally have TC in the default directory:
C:\Program Files (x86)\totalcmd
Pressing the "Original Button" I get the error message:
  • Error: Cannot write C:\Program Files (x86)\totalcmd\default.bar!
    Please remove the write protection!
I think this is why "cm_ConfigSaveSettings" doesn't work.

Everything seems to work as soon as I have TC in any other directory.


However the whole point of making the "original button", was to circumvent moving TC from the default directory to somewhere else to allow write privileges.


(By original button i mean: cm_ConfigSaveSettings, em_Run-as-Admin, cm_Exit)
I finally get notifications from emails again!!!
So happy!
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Post by *tuska »

JimmyTheBroker wrote:... write protection! ...
Everything seems to work as soon as I have TC in any other directory.
The forum is full of such error messages regarding write permissions (search the forum for: write protection).
The logical conclusion is that you set up TC in a place where you have write access.

One solution would be to use TC portable and move the installation to a place where you have write access, eg D:\TC, I:\TC, etc.

The conversion would require an effort once, but I think this effort is worthwhile.
All of the solutions mentioned in this thread (with appropriate settings) would work fine then.

You could use the portable TC-version from the PC, e.g. also on an USB stick.
Subsequently, differences between the portable TC version on PC and USB stick could be adjusted, for example, with asymmetrical synchronization.
Post Reply