Garbage in wincmd.ini: unwanted entries which I don't need at all
Moderators: Hacker, petermad, Stefan2, white
Garbage in wincmd.ini: unwanted entries which I don't need at all
I get too much garbage in wincmd.ini here:
[Command line history]
[LastTracks]
[LeftHistory]
[lefttabs]
[MkDirHistory]
[NewFileHistory]
[rename]
[RenameSearchFind]
[RenameSearchReplace]
[RenameTemplates]
[RightHistory]
[righttabs]
[SearchIn]
[SearchName]
[SearchText]
[Selection]
What should i change so that I will never get collect it again there?
Also I have garbage tcDirFrq.txt file and some treeinfo*.wc files.
I also need to get them away and never collect them again.
[Command line history]
[LastTracks]
[LeftHistory]
[lefttabs]
[MkDirHistory]
[NewFileHistory]
[rename]
[RenameSearchFind]
[RenameSearchReplace]
[RenameTemplates]
[RightHistory]
[righttabs]
[SearchIn]
[SearchName]
[SearchText]
[Selection]
What should i change so that I will never get collect it again there?
Also I have garbage tcDirFrq.txt file and some treeinfo*.wc files.
I also need to get them away and never collect them again.
Re: Garbage in wincmd.ini
Redirect all these sections to read only, empty file e.g.
Code: Select all
[Command line history]
RedirectSection=EMPTY.INI
[LastTracks]
RedirectSection=EMPTY.INI
[LeftHistory]
RedirectSection=EMPTY.INI
[lefttabs]
RedirectSection=EMPTY.INI
Re: Garbage in wincmd.ini
Is that the only way? Can't use this.
Can I use RedirectSection=null, RedirectSection=0 or something like that?
Can I use RedirectSection=null, RedirectSection=0 or something like that?
Re: Garbage in wincmd.ini
Some history can be disabled via Options > Operation > Save on exit. The rest can be disabled via RedirectSection as shown by Gral. For more information on RedirectSection see TC help, section 4.b, wincmd.ini.
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: Garbage in wincmd.ini
Out of curiosity, why not?
From my point of view, it's the most convenient way to deal with the 'garbage'.
You redirect all the things you consider garbage into the garbage.ini and forget it.
For me, it's an ideal scenario, far not all the tools provide similar functionality.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: Garbage in wincmd.ini
If you do this, files with these names will be created.qzute wrote: 2024-01-05, 18:06 UTC Is that the only way? Can't use this.
Can I use RedirectSection=null, RedirectSection=0 or something like that?
But you can use trick - redirect to existing directory name. (I'm not sure whether such a trick always work properly!)
Re: Garbage in wincmd.ini
You can redirect to a path too:
Try e.g.
RedirectSection=%temp%\xFgvjty
RedirectSection=C:\Temp\hsltva
Try e.g.
RedirectSection=%temp%\xFgvjty
RedirectSection=C:\Temp\hsltva
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Garbage in wincmd.ini: unwanted entries which I don't need at all
There is a smart solution using NUL device (a special virtual file that discards all data written to it):
NUL is part of the OS since DOS and still available at Windows 
Code: Select all
[MkDirHistory]
RedirectSection=NUL

#5767 Personal license
Re: Garbage in wincmd.ini: unwanted entries which I don't need at all
Does NUL cause any problems or not?
Re: Garbage in wincmd.ini: unwanted entries which I don't need at all
So the OP intends to not deal with garbage postfactum at all (even on RedirectSection=garbage.ini level), but to prevent its creation and storing preliminarily.
With that approach, the idea of RedirectSection=nul looks cool.
Going further that way, I made myself a user command that restarts TotalCommander without any settings:
That will be useful for testing purposes when a clean copy of TC is required.
It's quick since it allows the use of the existing installation without affecting it and without the need for a new installation.
Of course, it would prevent any settings adjustments since writing to .ini becomes unavailable.
So, if access to the settings is a must, the commands would be like this (this case implies %temp% cleanup when needed):
With that approach, the idea of RedirectSection=nul looks cool.
Going further that way, I made myself a user command that restarts TotalCommander without any settings:
Code: Select all
[em_noini]
cmd=%commander_exe% /i=nul /f=nul
[em_nul]
cmd=cm_exit,em_noini
It's quick since it allows the use of the existing installation without affecting it and without the need for a new installation.
Of course, it would prevent any settings adjustments since writing to .ini becomes unavailable.
So, if access to the settings is a must, the commands would be like this (this case implies %temp% cleanup when needed):
Code: Select all
[em_tempini]
cmd=%commander_exe% /i=%temp%\wincmd.ini /f=%temp%\wcx_ftp.ini
[em_temp]
cmd=cm_exit,em_tempini
Last edited by beb on 2024-01-06, 05:16 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: Garbage in wincmd.ini
I'm afraid the way described there is not bringing much happiness to the OP since she implies there's no interest in removing the 'garbage' -- the pretty reasonable idea is the garbage shouldn't have been created, to begin with.
Cheers
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Re: Garbage in wincmd.ini
Pretty?beb wrote: 2024-01-06, 05:43 UTC the pretty reasonable idea is the garbage shouldn't have been created, to begin with.

This is a bad idea for me, because the templates and the history of the combo boxes in the current session give their advantages. And clearing the config after completing or starting will not allow outsiders to find out what the previous user used, which is a much more reasonable approach.
Last edited by Fla$her on 2024-01-06, 08:12 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: Garbage in wincmd.ini: unwanted entries which I don't need at all
And if the .ini(s) are already there while meant not to (when the new clean restart reqired):beb wrote: 2024-01-06, 05:12 UTC So, if access to the settings is a must, the commands would be like this (this case implies %temp% cleanup when needed):Code: Select all
[em_tempini] cmd=%commander_exe% /i=%temp%\wincmd.ini /f=%temp%\wcx_ftp.ini [em_temp] cmd=cm_exit,em_tempini
Code: Select all
[em_tempini]
cmd=%commander_exe% /i=%temp%\wincmd.ini /f=%temp%\wcx_ftp.ini
[em_tempiniclean]
cmd=pwsh -command Get-ChildItem $env:Temp -recurse -include ('wincmd.ini','wcx_ftp.ini')|Remove-Item -force
[em_nul]
cmd=cm_exit,em_tempiniclean,em_tempini
Code: Select all
[em_tempiniclean]
cmd=%comspec% /q/c for /r %temp% %f in (wincmd.ini,wcx_ftp.ini) do del /q "%~ff"
Edit: %/%% related cmd syntax fix. Thanks to Fla$herFla$her wrote: 2024-01-06, 09:40 UTCCode: Select all
cmd=%comspec% /q/c del/q "%temp%\wincmd.ini" "%temp%\wcx_ftp.ini"
Last edited by beb on 2024-01-06, 11:29 UTC, edited 2 times in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15