Directory Hotlist: Use environment variables

Please report only one bug per message!

Moderators: sheep, Hacker, Stefan2, white

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: 39920
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
http://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 9799
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, 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 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (2004) 64bit, 'Everything' 1.4.1.988 (x64)
TC 3.10b8 on Android 6.0
Get:
Extended TC Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply