Input option (ask user) for item in directory menu possible?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
GerH
Junior Member
Junior Member
Posts: 3
Joined: 2020-03-25, 16:02 UTC

Input option (ask user) for item in directory menu possible?

Post by *GerH »

I'm using an directory menu with multiple options to change network shares.

I also want to create an option to switch to a local folder on a computer in the network.
Normaly I do this like: cd \\computername\c$

is it possible to replace "computername" with an parameter and have a dialog box to popup, that makes it possible key in the computername?
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Input option in directory menu?

Post by *Stefan2 »

Hi and welcome.

You can create your own user defined command (search for usercmd.ini or ask)

There you can use a question sign as very first parameter in the parameters place.
That will pop-up the command on executing, so you can inspect and modify.
Command: CD
Parameters: ? \\computername\c$


Next call that UDC in your menu entry.


Or see MVVs' AskParam (http://totalcmd.net/plugring/askparam.html) tool.

Or use TCs Command line parameters (see help) via an own made script to switch on the fly to another folder.
In that script you can use an InputBox to ask for the parameter beforehand.
smtg like:
strXY = InputBox "Server?"
%Commander_Exe% /O /S /L=strXY


You can test that possibilities with an button first.


 
GerH
Junior Member
Junior Member
Posts: 3
Joined: 2020-03-25, 16:02 UTC

Re: Input option in directory menu?

Post by *GerH »

Thanks Stefan2.
It looks quite complicated because I really do not have any experience with customizing Total Commander at all.
I will check what you suggested.
Thanks
GerH
Junior Member
Junior Member
Posts: 3
Joined: 2020-03-25, 16:02 UTC

Re: Input option (ask user) for item in directory menu possible?

Post by *GerH »

Yessss, I managed to use the first option.

My next goal is to create a user command that creates two folders in the current folder I'm working in.
So I wondered, is there a sort of guidance document to learn programming TC?
The help file of TC did not help me so far.
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Input option (ask user) for item in directory menu possible?

Post by *Stefan2 »

GerH wrote: 2020-04-12, 14:39 UTC Yessss, I managed to use the first option.
Yes, you did it.
Would have been nice if you would had share your work for others having the same question.


GerH wrote: 2020-04-12, 14:39 UTC So I wondered, is there a sort of guidance document to learn programming TC?
No, not really, as you would use a standard programming language as MS-DOS Batch; AutoHotkey; PowerShell; JS; PowerPro;...
TC will provide you by parameters for your script which give you some information about the selected files, and more.


GerH wrote: 2020-04-12, 14:39 UTC My next goal is to create a user command that creates two folders in the current folder I'm working in.
If you have more questions regarding that issue or need help on making an script, then just open a new thread for that, or search the forum.
Please don't mix up different things in one single thread.




 
Post Reply