Custom command CDing to a subfolder entered by user

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
detlefs
Junior Member
Junior Member
Posts: 5
Joined: 2020-11-17, 08:08 UTC

Custom command CDing to a subfolder entered by user

Post by *detlefs »

Hi there,

I want to create a custom command that CDs to a folder the user enters. I try so far:

[em_OpenTicketAttachment]
cmd=CD
param=?
path=z:\Base\

So, my idea is that the user enters the "ticket number" (e.g. 12345) and then the CD command changes to z:\base\12345
But it doesn't work. The dialog is opened and user can enter 12345, but the CD only changes directory to z:\Base

Any idea how to solve this?
User avatar
Gral
Power Member
Power Member
Posts: 1600
Joined: 2005-01-26, 15:12 UTC

Re: Custom command CDing to a subfolder entered by user

Post by *Gral »

Wouldn't it be easier to use a CD tree (ALT+F10) where you can enter a directory name?
User avatar
Dalai
Power Member
Power Member
Posts: 9971
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Custom command CDing to a subfolder entered by user

Post by *Dalai »

Well, if Z:\Base is your base directory, I would just add that to the directory hotlist (Ctrl+D). Then you can just type the ticket number, provided Quick Search is set accordingly (see Configuration > Options > Quick Search).

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
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Custom command CDing to a subfolder entered by user

Post by *petermad »

2detlefs
Help wrote:If the command (given in the command box) is cd drive:\directory, then the path given in this edit box is set in the other window! This allows you to set both paths (source and target) at the same time.
So your only option is to use:

Code: Select all

[em_OpenTicketAttachment]
cmd=CD
param=?z:\Base\

I tried:

Code: Select all

[em_OpenTicketAttachment]
cmd=CD z:\Base\
param=?z:\Base\
but it doesn't work because TC inserts a space after z:\Base\
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
Post Reply