Directory Hotlist: Use environment variables

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
mhewel
New Member
New Member
Posts: 1
Joined: 2019-03-21, 08:00 UTC

Directory Hotlist: Use environment variables

Post by *mhewel »

I'm using a lot of temporary files, which I store in a structure like this:
"c:\data\temp\<year>\<month>\<day>\",
e.g. "c:\data\temp\2019\09\20\" for files made today

I tried to make an entry in the directory hotlist with this command (which works in a CMD session):
cd c:\data\temp\%date:~6,4%\%date:~3,2%\%date:~0,2%

it looks like environment variables are not used at all, or the command need to be tweaked (escape characters).
Please help

Thanks

/Mikael
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Directory Hotlist: Use environment variables

Post by *ghisler(Author) »

Environment variables are supported, but not ranges like :~3,2
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Directory Hotlist: Use environment variables

Post by *petermad »

2mhewel
Try this - make this command in your usercmd.ini file:

Code: Select all

[em_opendatefolder]
cmd=%COMSPEC% /C
param=Start "" %%COMMANDER_EXE%% /O /S /L="c:\data\temp\%%date:~6,4%%\%%date:~3,2%%\%%date:~0,2%%"
iconic=1
And then put em_opendatefolder in the "Command:" field of your Directory hotlist entry.

You can also use em_opendatefolder in a Button on the buttonbar or assign it to a Keyboard shortcut or use it in the Start menu or the Main menu, and use it on the command line.

EDIT
Unfortunately the /S parameter is not supported when used in the directory hotlist - so the dir is always opened in the left panel, not the source panel. It works OK in Buttons, Start menu and Command line - just not in Directory hotlist.
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