Custom Commands
FileMenu Tools lets you configure custom commands which will be added to context menu of the Windows File Explorer. There are six command types which let you make specific actions. This actions are:
- Run an external program, whose arguments are the selected elements.
- Copy the selected elements to an specific folder.
- Move the selected elements to an specific folder.
- Delete specific file types into the selected folders.
- Rename the selected files.
- Send the selected elements to mail recipients with specific parameters (e-mail recipients, subject and body).
From the Commands of FileMenu Tools tab of the configuration window you can add new commands, delete commands and change the command properties.
In order to add a new command click Add Command action. The new command will be added to the list and its name will be New Command.
In order to change the properties of a command, you must use the properties panel. There are common properties and specific properties for each command type.
NOTE: FileMenu Tools doesn't allow to run custom commands if you are using the free license of the application. You must purchase and activate a Full license in order to run custom commands.
Common Properties
- Action. The action which will be run: run program, copy to a folder, move to a folder, delete specific files, send to email recipient or rename files.
- Modifier Key. The custom command only will be shown in the context menu if this key is pressed while the menu is displaying. The key is any of the following: SHIFT, CONTROL, or WINDOWS. If you set this parameter to "None", then the command always will be displayed in the context menu.
- Show in context menu (Windows 11 only). Windows 11 has entirely refreshed the context menu and has replaced it with a completely new menu. You still can access to the classic menu when you click on "Show more options". FileMenu Tools can be displayed in both context menus. With the "Show in context menu" property you can configure in which context menu the command will be displayed: in the new context menu on Windows 11 or in the classic context menu or both. This property only will be possible to change it if the global setting "Show the commands of FileMenu Tools in the following context menu" is set to "Configure individually for each command" (click here for more info).
- Sort Files. Specifies if to sort the selected elements before running the command. The elements can be sorted by name, by type, by creation time, by last write time or by file size; ascending or descending. The variables containing the selected elements (%FILEPATHS%, %FILEPATH1%, etc) will be set according to this property.
- Menu Text. Text to be shown in the context menu.
- Description. A short description which describes the command.
- Icon. The icon to be displayed in the context menu. If you click on the right side button then a dialog box will be displayed to browse and select the icon.
- Element Types. The command will be displayed only when any selected element in the Windows Explorer belongs to any of these element types. The element types can be files, folders or drives.
- Files: you may specify the file extensions separated with a comma. You can use wildcards (* and ?) and if you wish to specify all file types then enter * wildcard.
- Folders: by default the command is displayed with all the folders, but you can specify also specific folders by typing the folders in the "Specific Folder" field. The folders must be separated with semicolons. You can use wildcards (* and ?), and specify both relative paths and absolute paths. For example: if you specify "Temp*", then the command will be displayed only when the selected folder begins with "Temp".
- Drives: you can specify the drive types: fixed drive, removable drive, CD-ROM/DVD-ROM, network drive and RAM disk.
- Number of elements: specifies how many elements must be selected in the Windows Explorer to show the command in the context menu. You can set the minimum and the maximum number of elements. For example, if you set minimum to 1 and maximum to 3, then the command will not be shown if you select 4 or more elements.
The "Element Types" property has a button in the right side to allow you to save and load profiles. So you can save very used Element Types (file extensions, specific folders, etc) in a profile, and load it later in other custom commands. For example: Audio files, Video files, Binary files. If you set a default profile, then this profile will be loaded when you add new custom commands.
Program Properties
- Program. The full path of the program file, or relative path as regards installation folder of FileMenu Tools.
- Arguments. The arguments which must be given to the program. If you don't specify this field, by default, the arguments will be the path of all the selected elements in the Windows Explorer. You can specify various variables which will be replaced with its value when the program runs. In order to insert a variable, click over the right side button and select the variable from the context menu. The possible variables are the following:
- %: no arguments will be given to the program. This behavior replaces the default behavior if Arguments field is empty (the path of all the selected elements in the Windows Explorer).
- %DRIVE%: drive letter which is common to the all selected elements.
- %FOLDERPATH%: if only a folder is selected in Windows Explorer, then this variable is this folder, else this variable is the parent folder path which is common to all the selected elements.
- %PARENTPATH%: parent folder path which is common to all the selected elements.
- %FOLDERNAME%: name of the parent folder.
- %RELPATH%: parent folder path without drive.
- %FILEPATHS%: full paths of all the selected elements. This is the default variable if you don't specify any argument.
- %FILENAMES%: names of all the selected elements.
- %FILEPATHn%: full path of the element at position n.
- %FILENAMEn%: name of the element at position n.
- %FILETITLEn%: title (name without extension) of the element at position n.
- %FILEEXTn%: extension of the element at position n.
- %TEMPFILEPATHS%: save the full paths of all the selected elements in a temporary file and the variable will be replaced with the full path of this temporary file.
- %TEMPFILENAMES%: save the names of all the selected elements in a temporary file and the variable will be replaced with the full path of this temporary file.
- %TARGET...%: if you add the prefix TARGET to any above variable, then if you select shortcuts in the Windows Explorer, the variable will access to the target files of the shortcuts.
- @Message@: custom variable. The variable value will be requested when the program runs. Message is the text which will be displayed when the value is requested.
- @OPENFILE:Message@: lets you select a file when the program runs. The Open File Dialog will be shown to select the file. Message is the text which will be displayed in the dialog.
- @SAVEFILE:Message@: lets you select a file for save when the program runs. The Save File Dialog will be shown to select the file. Message is the text which will be displayed in the dialog.
- @FOLDER:Message@: lets you select a folder when the program runs. A dialog will be shown to select the folder. Message is the text which will be displayed in the dialog.
- <A;B;C>: look for the string B into the string A and replaces it with the string C. The string A may include variables. For example: if you include <%FILEPATHS%;.txt;.bak>, then all the files with .txt extension will be changed with .bak extension.
- <*A;B;C>: look for the string B into the string A and replaces it with the string C. You may use regular expressions, and the string A may include variables. For example: if you include <*%FOLDERPATH%;(\w\:\\)(\w*);C:\\$2>, and you select the file "D:\My Folder\My File.txt", then this will be replaced with "C:\My Folder" (the parent folder in the C: drive instead the D: drive).
- Working Folder. The working folder which the program will be run. You can specify the following variables:
- %DRIVE%: drive letter which is common to the all selected elements.
- %FOLDERPATH%: if only a folder is selected in Windows Explorer, then this variable is this folder, else this variable is the parent folder path which is common to all the selected elements.
- %PARENTPATH%: parent folder which is common to all the selected elements.
- Several Instances. Indicates if to run several instances of the external application, one for each selected item in Windows Explorer. This can be useful for programs that support only a filename as parameter. If this parameter is different to "No", then the variables as %FILEPATH1%, %FILENAME1%, etc., take on each new instance of the application executed each of the selected files in Windows Explorer. The possible values may be one of the following:
- No: normal behavior, that is to say, a single instance of the application is run, passing all selected files.
- Simultaneous: all instances of the application are run simultaneously.
- Sequential: each instance of the application is run sequentially, that is to say, an instance of the application only runs the same time, and a new instance only is run when the previous instance is terminated. If you set this value, then you can also set two additional parameters: enter in subfolders and show progress bar.
- Several Instances/Enter in subfolders: only available if "Several Instances" is sequential. If this parameter is set to "Yes", then enters recursively in all selected folders and subfolders and run a new instance of the application for each element within these folders. It will be considered only the elements that are the same type as specified in the general parameter "Element Types".
- Several Instances/Show Progress Bar: only available if "Several Instances" is sequential. If this parameter is set to "Yes", then will display a progress bar during the execution of each of the instances of the application. So it is possible to know at any time how many instances remain to run.
- Run As Administrator. Choose "Yes" if the program must be run with administrator privileges. If UAC is enabled, then a dialog box will be displayed to confirm the action.
- Process Priority. Specifies the priority class in which the process will run: Real time, High, Above normal, Normal, Below normal, Idle.
- Convert paths to URL format. If "Yes", then the selected files will be converted to URL format when they are passed to the program. This means that "file://" will be added to the beginning of the file and the special characters will be replaced (for example the blank spaces will be replaced with %20).
Copy/Move Properties
- Target Folder. The folder where the selected elements will be copied/moved to. You can include the following variables:
- %DRIVE%: drive letter which is common to the all selected elements.
- %FOLDERPATH%: if only a folder is selected in Windows Explorer, then this variable is this folder, else this variable is the parent folder path which is common to all the selected elements.
- %PARENTPATH%: parent folder path which is common to all the selected elements.
- %FOLDERNAME%: name of the parent folder.
- %RELPATH%: parent folder path without drive.
- %FILEPATHn%: full path of the element at position n.
- %FILENAMEn%: name of the element at position n.
- %FILETITLEn%: title (name without extension) of the element at position n.
- %FILEEXTn%: extension of the element at position n.
- %TARGET...%: if you add the prefix TARGET to any above variable, then if you select shortcuts in the Windows Explorer, the variable will access to the target files of the shortcuts.
- File Types. The file types to copy/move. There are three options: all files, only files match the filters, or only files does not match the filters. If you choose any of last two options, you must specify the file types.
- Overwrite. If "Yes", when coping/moving an existing file, you will be asked if the file must be overwritten or not.
- Open target folder. If "Yes" then a new instance of Windows Explorer will be open with the target folder.
Delete Properties
- File Types. The file types to delete. There are three options: all files, only files match the filters, or only files does not match the filters. If you choose any of last two options, you must specify the file types.
- Enter in subfolders. If "Yes", then the delete process will delete recursively in all subfolders that the selected folders contain.
- Move to Recycle Bin. If "Yes", the files will be moved to recycle bin and will be not deleted.
Rename Properties
- Profile Name. Profile name of "Advanced Renamer" tool to be used when renaming.
- Enter in subfolders. If "Yes", then the renaming process will rename recursively in all subfolders that the selected folders contain.
- Element Types to Rename. Element types to be affected for the renaming process: both files and folders, only files or only folders.
- File Types. The file types to rename (only used if Element Types to Rename includes files). There are three options: all files, only files match the filters, or only files does not match the filters. If you choose any of last two options, you must specify the file types.
- Conflict Behavior. The action to perform if a conflict exists while renaming a file, that is, if a file really exists with the same name in the same folder. The possible options are: prompt, no rename the file, overwrite the existing file, and add a numeric sequence.
- Show Preview. Show a window with the preview before renaming the files. So you can see the final result for all the files before applying the changes. If this field is unchecked, then only a confirm dialog will be displayed to confirm if you wish to continue with the renaming process, but you can not see if the files will be renamed correctly.
- Close window automatically. If "Yes", then the Advanced Renamer window will be closed after renaming.
- Request confirmation. If "Yes", then a message box will be displayed before starting the renaming process to confirm this action is wished. If "Show Preview" is "Yes", then the "Request confirmation" property is ignored and the confirmation message box will not be displayed, because the preview is already shown.
Send e-mail Properties
- To. The e-mail recipients. They must be separated with semicolon.
- CC. Another e-mail recipients. They must be separated with semicolon.
- BCC. Hidden e-mail recipients. Unlike the To and CC fields, the e-mail addresses added to BCC are invisible to the recipients of the message.
- Subject. The message subject.
- Body. The message body. The line feeds are indicated with \n.