Bookmark to dynamic folder

English support forum

Moderators: Stefan2, white, sheep, Hacker

Post Reply
icehockey
New Member
New Member
Posts: 1
Joined: 2018-05-23, 20:18 UTC

Bookmark to dynamic folder

Post by *icehockey » 2018-05-23, 20:26 UTC

Hi folks,

I have been searching for a while and could not find a clear answer for this problem:

I have folders that is dynamically created by a service:
C:\Apps\Node.1\Instance\a\b\Log\App_1\logfile.txt
C:\Apps\Node.2\Instance\a\b\Log\App_1\logfile.txt
C:\Apps\Node.3\Instance\a\b\Log\App_1\logfile.txt

Every time a new app is deployed, App_1 becomes App_2 so so forth. The location of the logfile is also not-deterministic (sometimes Node.1, sometimes Node.2, sometimes Node.3). This makes using hotlist not very convenience (can only go to the upper level folder Node.1, Node.2)

I want to make a shortcut/button to access these log file quickly in TC by creating a button to "cd C:\Apps\Node.1\Instance\a\b\Log\App_*\" but looks like it is not working this way.

Also if I have 3 nodes, I need to create 3 shortcut like this. It would be ideal to have a drop-down list or something similar.

Any idea on how to do this?

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

Post by *ghisler(Author) » 2018-05-24, 09:31 UTC

App_* cannot be used because it wouldn't be clear which directory is meant when there are multiple. Are you in control of the service? If yes, you could set an environment variable with the latest path name or directory name. Then you could use something like this:
cd %envpath%
or
cd C:\Apps\Node.1\Instance\a\b\Log\%envname%
Also if I have 3 nodes, I need to create 3 shortcut like this. It would be ideal to have a drop-down list or something similar.
You could add a sub-bar and check the option to show it as a popup.
Author of Total Commander
http://www.ghisler.com

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3007
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp » 2018-05-24, 09:51 UTC

I would do it as follows:
Make a branch view of the root level.
This can be made with a View mode and Auto-switch.
Then select the newest file from it.
The following button selects the newest file in the active view.

Code: Select all

TOTALCMD#BAR#DATA
cmd.exe
/k "for /f "usebackq delims=" %%f in (`dir /b /a-d /o-d`) do start "" "%%COMMANDER_EXE%%" /O /S /L="%%~ff\:" & exit"
C:\Tools\Wincmd\Icons\Down-Blue.ico
Newest File

1
-1
Windows 10 x64 Version 1803
April 2018 Update (OS Build 17134.228)
TC 9.21 x64 and x86, Everything 1.4.1.907 (x64)

User avatar
nsp
Power Member
Power Member
Posts: 1187
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Bookmark to dynamic folder

Post by *nsp » 2018-05-24, 13:09 UTC

icehockey wrote:Hi folks,

I have been searching for a while and could not find a clear answer for this problem:

I have folders that is dynamically created by a service:
C:\Apps\Node.1\Instance\a\b\Log\App_1\logfile.txt
C:\Apps\Node.2\Instance\a\b\Log\App_1\logfile.txt
C:\Apps\Node.3\Instance\a\b\Log\App_1\logfile.txt

Every time a new app is deployed, App_1 becomes App_2 so so forth. The location of the logfile is also not-deterministic (sometimes Node.1, sometimes Node.2, sometimes Node.3). This makes using hotlist not very convenience (can only go to the upper level folder Node.1, Node.2)

I want to make a shortcut/button to access these log file quickly in TC by creating a button to "cd C:\Apps\Node.1\Instance\a\b\Log\App_*" but looks like it is not working this way.

Also if I have 3 nodes, I need to create 3 shortcut like this. It would be ideal to have a drop-down list or something similar.

Any idea on how to do this?
You could use virtualpanel to dynamically generale the list using a autorun script. (you should familiarize to VP)


If you only need logfile.txt you could filter on logfile.txt and use branchview from C:\Apps and even add a user column to show the folder APP1 ....

These are hints using user commands:
em_gotoApps as CD C:\Apps
em_only_logfile to only see logfile.txt CD logfile.txt ( you can also create a command to reset filter em_noFilter as CD *.*)
em_buildlogfileList a command to "show logfile.trxt" or directly assign it to a button. em_gotoApps,em_only_logfile,cm_DirBranch

You can also use date ordering...

Post Reply