Methods to Insert Directory Path

Directory name completion or insertion in FireCMD shell can be done in three ways:

  1. Using context menu
  2. Using command substitution and getdir command
  3. Using command substitution and pathc command

Using context menu

Simply right click and from the context menu that appears, select Insert Directory. This will open Browse For Folder dialog which will allow you to insert a directory path. Note that the directory path will be enclosed within double quotes. This method also works in terminal emulator i.e. you can also use the context menu to insert directory path in other console programs and shells such as command prompt, PowerShell etc.

FireCMD context menu

Using command substitution and getdir command

The disadvantage of the first method i.e. using context menu is that it is not compatible with alias. To overcome this limitation, command substitution and getdir command can be used together to insert a directory path in the command line and moreover the command line can be given an alias. For example using cd, getdir and command subtitution we can create an alias, say cd3 (remember that cd2 is an in-built alias for cmd.exe's cd command) which allows user to change the current working directory using the Browse For Folder dialog. The command line to create such an alias named cd3 is as follows:

alias cd3 cd "+|getdir "Select a folder and click on OK button to |||set it as current working directory."|"

After creating the above mentioned alias, you can simply type cd3 and press enter to change the directory using Browse For Folder dialog box.

Using command substitution and pathc command

We can also use the pathc with command substitution. When the user starts typing the directory path, it suggests path elements which can be used to complete the folder path. It is advisable to use first two methods as pathc does not limit the path auto-completion to directory paths and also shows the file names.

Example: cd "+|pathc "Enter directory path and click on OK button"|"