Run TC in read-only mode, is it possible?
Moderators: Hacker, petermad, Stefan2, white
Run TC in read-only mode, is it possible?
Hi!
During my work (now in home office) I often have to browse through and read documents located on file shares on company servers, therefore at any given moment I probably have one or more TC-s open with the content of those resources showing in them.
Most of the time I only have to read stuff, but sometimes I have to edit too (create/delet/edit files or folders), therefore I have write access to those resources.
Is three a way to switch (or run) TC in read-only mode to avoid accidental edit/move/delete operations?
(I know it is possible to set TC to ask for confirmation in cases like that, but I have a cat , who can "accidentally" step on the Enter key in a case like that, so I am afraid a simple "Are You sure?" kind of confirmation is not good enough.)
Thanks.
During my work (now in home office) I often have to browse through and read documents located on file shares on company servers, therefore at any given moment I probably have one or more TC-s open with the content of those resources showing in them.
Most of the time I only have to read stuff, but sometimes I have to edit too (create/delet/edit files or folders), therefore I have write access to those resources.
Is three a way to switch (or run) TC in read-only mode to avoid accidental edit/move/delete operations?
(I know it is possible to set TC to ask for confirmation in cases like that, but I have a cat , who can "accidentally" step on the Enter key in a case like that, so I am afraid a simple "Are You sure?" kind of confirmation is not good enough.)
Thanks.
Re: Run TC in read-only mode, is it possible?
All you can do is to remap the keys that start deletions, namely F8 and DEL (delete) as well as F4 (edit) and F6 (move), in TC's options > Misc section. Remap these keys to a command that doesn't do anything drastic like cm_RereadSource or cm_FocusLeft or similar. And maybe hide the function key buttons (Options > Layout) because dragging files to such a button also starts the corresponding operation. Keep in mind that the context menu still works and is another way to edit/move/copy/delete files.
However, as such remappings would seriously hamper the regular work in TC, I recommend to start TC with a separate INI, like this:(Replace totalcmd.exe by totalcmd64.exe if you use TC 64-bit.)
And to be able to tell which TC instance is active, maybe change the colors, especially the background color. See Options > Color
Regards
Dalai
However, as such remappings would seriously hamper the regular work in TC, I recommend to start TC with a separate INI, like this:
Code: Select all
totalcmd.exe /i="%TEMP%\work.ini"
And to be able to tell which TC instance is active, maybe change the colors, especially the background color. See Options > Color
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- ghisler(Author)
- Site Admin
- Posts: 50561
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Run TC in read-only mode, is it possible?
If you just want to prevent opening of files via double click or enter, you can add
RestrictInterface=128
to the wincmd.ini section [Configuration]
From the help:
RestrictInterface= Disable parts of the user interface. Just build the sum of the following options:
1=Start menu
2=Command line
4=Buttonbar change
8=Drive right click menu
16=File right click menu
32=Directory hotlist change
64=FTP (CTRL+N, CTRL+F)
128=ENTER key (run programs, open files)
256=File system plugins
512=Port connection (via USB or LPT)
1024=Disable update checks (manual and automatic)
2048: Disallow plugins except if signed by us (ghisler)
4096: Disallow plugins without a valid digital signature
6144: Disallow all plugins
RestrictInterface=128
to the wincmd.ini section [Configuration]
From the help:
RestrictInterface= Disable parts of the user interface. Just build the sum of the following options:
1=Start menu
2=Command line
4=Buttonbar change
8=Drive right click menu
16=File right click menu
32=Directory hotlist change
64=FTP (CTRL+N, CTRL+F)
128=ENTER key (run programs, open files)
256=File system plugins
512=Port connection (via USB or LPT)
1024=Disable update checks (manual and automatic)
2048: Disallow plugins except if signed by us (ghisler)
4096: Disallow plugins without a valid digital signature
6144: Disallow all plugins
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Run TC in read-only mode, is it possible?
@2ghisler(Author)
I am more worried about deleting files or folders accidentally (because it is possible to do with only 2 key presses in the "best" case).
Opening files unintentionally is not really a concern, because it is much less probable to open AND edit AND than save a file by random keystrokes, I think (as opposed to pressing DEL and Enter, which are close to each other, by chance).
Though, It would be nice to be able to prevent this too.
The best solution would be to have a command or switch to put TC in read only mode, but setting it to ask for confirmation AND disabling Enter seems to be a sufficient workaround for now.
Thank You!
I am more worried about deleting files or folders accidentally (because it is possible to do with only 2 key presses in the "best" case).
Opening files unintentionally is not really a concern, because it is much less probable to open AND edit AND than save a file by random keystrokes, I think (as opposed to pressing DEL and Enter, which are close to each other, by chance).
Though, It would be nice to be able to prevent this too.
The best solution would be to have a command or switch to put TC in read only mode, but setting it to ask for confirmation AND disabling Enter seems to be a sufficient workaround for now.
Thank You!
Re: Run TC in read-only mode, is it possible?
2GT19
It is only Enter on items in the file panels - not Enter in dialog boxes that is prevented with RestrictInterface=128 - so Del -> Enter = DisasterAND disabling Enter seems to be a sufficient workaround for now.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Run TC in read-only mode, is it possible?
@2GT19
You should probably make a suggestion to have a kiosk mode for TC where most of the file operations are prevented. This is the most secure from TC.
Another way is as suggested to redefine all file operation hotkey with a null user command in a special totalcmd.ini.
With some additional macro/automation soft like powerpro, autoit, autohotkey .... you can catch keystrokes before it reach totalcmd and then prevent some of the issues.
Another solution is to have a dedicated user who only have read only access on the system and then launch TC.
You should probably make a suggestion to have a kiosk mode for TC where most of the file operations are prevented. This is the most secure from TC.
Another way is as suggested to redefine all file operation hotkey with a null user command in a special totalcmd.ini.
With some additional macro/automation soft like powerpro, autoit, autohotkey .... you can catch keystrokes before it reach totalcmd and then prevent some of the issues.
Another solution is to have a dedicated user who only have read only access on the system and then launch TC.
Re: Run TC in read-only mode, is it possible?
Mounting the share twice (once with RW and once with RO rights) and then accessing two different paths in TC seems more reliable. That would decrease chances of accidental changes also by other software and not just TC itself. That could be done by using two different accounts and mount points for the one share. Or by having two separate shares available on the server.
Windows 10 Pro x64, Windows 11 Pro x64
Re: Run TC in read-only mode, is it possible?
As far as I know It is not possible to mount a share in read-only mode in Windows if my user account has write access to it.
But key remapping is actually a good idea.
I think I will remap all dangerous keys (Del, F8, F6, F5) to something harmless, like minimize TC.
Thanks.
But key remapping is actually a good idea.
I think I will remap all dangerous keys (Del, F8, F6, F5) to something harmless, like minimize TC.
Thanks.
Re: Run TC in read-only mode, is it possible?
You can launch TC with a dedicated ini File for your "Read Only" mode adding some color scheme to point current mode.GT19 wrote: 2020-11-08, 23:06 UTC I think I will remap all dangerous keys (Del, F8, F6, F5) to something harmless, like minimize TC.
Re: Run TC in read-only mode, is it possible?
GT19 wrote: 2020-11-08, 23:06 UTC As far as I know It is not possible to mount a share in read-only mode in Windows if my user account has write access to it.
But key remapping is actually a good idea.
I think I will remap all dangerous keys (Del, F8, F6, F5) to something harmless, like minimize TC.
Thanks.
cm_Minimize ; Minimize Total Commander
cm_Maximize ; Maximize Total Commander
For example you can map that keys to one of this internal commands:
cm_HelpIndex ; Help index
cm_Keyboard ; Keyboard help
cm_About ; Help/About Total Commander
Or to
cm_UserMenu987 ; Start 987th menu item in Start menu >> shows an error message if there is no such item defined
You can try that commands by executing them from TCs internal command line at the bottom of TCs window.
Or create an own UserDefinedCommand named maybe "em_Disabled" which launch e.g. a VBScript
which shows an MsgBox, or an PopupMsg with an automatic timeout.
Re: Run TC in read-only mode, is it possible?
I managed to create my safe configuration with certain risky keys remapped and colors set to indicate the active configuration.
I am wondering if it is possible to load this (or the "normal") configuration without restarting TC?
Is there an internal command for this that I could run by assigning a toolbar button to it?
It would be really nice to be able to switch between these 2 setups by just pressing a button instead of restarting.
Thanks.
I am wondering if it is possible to load this (or the "normal") configuration without restarting TC?
Is there an internal command for this that I could run by assigning a toolbar button to it?
It would be really nice to be able to switch between these 2 setups by just pressing a button instead of restarting.
Thanks.
Re: Run TC in read-only mode, is it possible?
Well, I'd just create another desktop link or TC button that starts another TC instance with the second wincmd.ini. No restart necessary, just another instance. See my first answer in the thread for a command that does this.
Regards
Dalai
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Run TC in read-only mode, is it possible?
The problem with this "other instance" approach is that while working I usually have multiple drives/shares/folders open on both sides of TC in different tabs. If I start a new TC instance I have to recreate all those tabs and reopen the same respective resources in all of them.
So my question remains: Is it possible to load a set of settings into TC from a pre saved config file while running?
Like it is possible to change settings from the configuration dialog "on the fly", but only manually, one by one.
It would be nice to be able to read up the desired settings from a file not just when TC is started, but also while running.
Thanks
So my question remains: Is it possible to load a set of settings into TC from a pre saved config file while running?
Like it is possible to change settings from the configuration dialog "on the fly", but only manually, one by one.
It would be nice to be able to read up the desired settings from a file not just when TC is started, but also while running.
Thanks
Re: Run TC in read-only mode, is it possible?
I don't think these changes can be made while TC is active.
Save your tabs as a separate .tab file (context menu of the tabs or SAVETABS or similar commands) and load them in the new instance (OPENTABS/APPENDTABS command). If you don't need any tabs but just the active directories in both panels the following command can be used:(you'd need to add the /i parameter from my post above to make TC use a different INI file)
Another approach is to redirect the [LeftTabs] and [RightTabs] sections to a common INI file that is shared by your regular wincmd.ini and your work.ini (as I called it above). Once that's done, a user-defined command (em_*) can be added that saves the current settings (which includes all open tabs) and launches another TC instance with a different INI file afterwards. Look in TC's help about RedirectSection - that can get you started on that possible solution.
Regards
Dalai
Save your tabs as a separate .tab file (context menu of the tabs or SAVETABS or similar commands) and load them in the new instance (OPENTABS/APPENDTABS command). If you don't need any tabs but just the active directories in both panels the following command can be used:
Code: Select all
"%COMMANDER_EXE%" %Z%X "%P" "%T"
Another approach is to redirect the [LeftTabs] and [RightTabs] sections to a common INI file that is shared by your regular wincmd.ini and your work.ini (as I called it above). Once that's done, a user-defined command (em_*) can be added that saves the current settings (which includes all open tabs) and launches another TC instance with a different INI file afterwards. Look in TC's help about RedirectSection - that can get you started on that possible solution.
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Run TC in read-only mode, is it possible?
2GT19
[left]
[right]
[lefttabs]
[righttabs]
[activetabs]
[RightHistory]
[LeftHistory]
For example:
[left]
RedirectSection=history.ini
Here is what I redirect of personal settings:
You can use a button like this to load your secure ini file:
Where secure_tc.ini and secure_tc_ftp.ini are your secure settings for TC''s main and ftp settings - which are placed in the same dir as your nornal totalcmd.ini file.
If you want setings like that to be common to both your totalcmd.ini file and your secure version of the ini file, you have to redirect those setiing to a third ini file in both of the ini files. It would be sections like these that should be redirected:usually have multiple drives/shares/folders open on both sides of TC in different tabs. If I start a new TC instance I have to recreate all those tabs and reopen the same respective resources in all of them.
[left]
[right]
[lefttabs]
[righttabs]
[activetabs]
[RightHistory]
[LeftHistory]
For example:
[left]
RedirectSection=history.ini
Here is what I redirect of personal settings:
Spoiler
Code: Select all
[attrplugin]
RedirectSection=history.ini
[rename]
RedirectSection=history.ini
[SyncOptions]
RedirectSection=history.ini
[Selection]
RedirectSection=history.ini
[SearchName]
RedirectSection=history.ini
[SearchIn]
RedirectSection=history.ini
[SearchText]
RedirectSection=history.ini
[RenameTemplates]
RedirectSection=history.ini
[RenameSearchFind]
RedirectSection=history.ini
[RenameSearchReplace]
RedirectSection=history.ini
[left]
RedirectSection=history.ini
[right]
RedirectSection=history.ini
[lefttabs]
RedirectSection=history.ini
[righttabs]
RedirectSection=history.ini
[Command line history]
RedirectSection=history.ini
[RightHistory]
RedirectSection=history.ini
[LeftHistory]
RedirectSection=history.ini
[MkDirHistory]
RedirectSection=history.ini
[NewFileHistory]
RedirectSection=history.ini
[TargetList]
RedirectSection=history.ini
[PluginDuplicates]
RedirectSection=history.ini
[DirSelection]
RedirectSection=history.ini
[activetabs]
RedirectSection=history.ini
[ButtonbarCache]
RedirectSection=history.ini
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_EXE% /N /i="%COMMANDER_INI%\..\secure_tc.ini" /f="%COMMANDER_INI%\..\secure_tc_ftp.ini"
%Z%X "%P" "%T"
%COMMANDER_EXE%
Open secure Total Commander
-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar