MultiTags Reference

MultiTags are dynamic text placeholders that provide Multi Commander's User Defined Commands with real-time access to file management context information. These powerful tags automatically resolve to current paths, selections, focused files, and system information, enabling commands to adapt dynamically to user actions and current workspace state without requiring manual input or hardcoded values.

Dynamic Context Integration

MultiTags bridge the gap between static command syntax and dynamic file management operations by injecting current context information directly into command parameters. These tags transform User Defined Commands into powerful automation tools that respond intelligently to file selections, panel states, and user interactions, creating adaptive workflows that enhance productivity through context-aware automation.

MultiTags Overview

MultiTags provide User Defined Commands with access to Multi Commander's current state and context information through specially formatted text placeholders that are automatically resolved during command execution.

How MultiTags Work
Processing Mechanism
1. Command Creation
  • Tag Insertion: Include MultiTags in command syntax using ${tagname} format
  • Dynamic Parameters: Replace static values with context-aware tags
  • Flexible Placement: Use tags anywhere within command parameters
  • Multiple Tags: Combine multiple tags in single commands
2. Execution Time
  • Context Capture: Multi Commander captures current workspace state
  • Tag Resolution: Each MultiTag replaced with actual current value
  • Real-Time Data: Values reflect current file selections and panel states
  • Command Assembly: Resolved command assembled with actual values
3. Command Execution
  • Final Command: Fully resolved command executed with real values
  • Context Accuracy: Operations use current file management context
  • Dynamic Behavior: Same command behaves differently based on context
  • Automatic Adaptation: Commands adapt to different scenarios
Key Benefits
  • Dynamic Adaptation: Commands automatically adapt to current context
  • User Convenience: No manual path entry or file specification required
  • Workflow Integration: Commands integrate seamlessly with file management tasks
  • Reusability: Same command works in different folders and with different files
Power of Context

MultiTags eliminate the need for static, hardcoded values in commands, creating truly dynamic automation that responds intelligently to user actions and current workspace state.

Command Type Compatibility

MultiTags support varies across different User Defined Command types, with most command types providing direct support while MultiScript requires special function calls for tag access.

Direct MultiTags Support
External Commands
  • Full Support: All MultiTags available in program paths and arguments
  • Path Integration: Perfect for launching applications with current file context
  • Parameter Passing: Pass current selections and paths to external tools
  • Dynamic Execution: Same external command adapts to different contexts
Custom Commands
  • Comprehensive Support: All tags available in command parameters
  • Function Parameters: Use tags in any Custom Command parameter
  • Advanced Operations: Enable sophisticated file management automation
  • Extension Integration: MultiTags work with extension-provided functions
Batch Script (.BAT)
  • Script Integration: MultiTags resolved before script generation
  • Path Quoting: Tags automatically integrated into batch syntax
  • Dynamic Scripts: Same script template adapts to different contexts
  • System Integration: Bridge Multi Commander context to Windows batch
Important Note

MultiTags are NOT automatically quoted. Always enclose path-based tags in quotes: "${sourcepath}"

MultiScript Special Handling
MultiScript Limitations and Solutions
Direct MultiTag Limitations
  • No Direct Support: MultiTags cannot be used directly in MultiScript variables
  • Variable Assignment: @var $path = "${sourcepath}"; does NOT work
  • Script Context: MultiScript has its own variable and function system
  • Alternative Required: Must use special functions for context access
Correct MultiScript Approaches
  • GetTagValue() Function: @var $path = GetTagValue("sourcepath");
  • Dedicated Functions: GetSourcePath(), GetTargetPath(), etc.
  • Custom Command Lines: MultiTags work in Custom Command calls from MultiScript
  • Mixed Approach: Combine MultiScript logic with Custom Command execution
MultiScript Integration

For MultiScript context access, use GetTagValue() function or dedicated context functions like GetSourcePath().

Complete MultiTags Reference

This comprehensive reference covers all available MultiTags organized by category for easy lookup and understanding of each tag's purpose and output format.

Complete MultiTags List
MultiTag Description Example Output
File and Folder Focus
${focusfilepath} Full path to the file/folder currently in focus C:\Program Files\MultiCommander\MyFile.exe
${sourcefocuspath} Full path to item in focus in the source view (same as ${focusfilepath}) F:\my folder\filename.txt
${targetfocuspath} Full path to item in focus in the target view D:\Temp\Folder 2\report.txt
${sourcefocusname} Name of item in focus in the source view filename.txt
${targetfocusname} Name of item in focus in the target view report.txt
${sourcefocusext} Extension of item in focus in the source view txt
${targetfocusext} Extension of item in focus in the target view txt
Panel Paths and Locations
${sourcepath} Current path of the source panel C:\Program Files\MultiCommander\
${targetpath} Current path of the target panel D:\MyBackup\
${sourcedevice} Current device/drive letter of the source panel C
${targetdevice} Current device/drive letter of the target panel D
Left/Right Panel Tags (Independent of Source/Target)
${leftpath} Current path of the left panel C:\Documents\
${rightpath} Current path of the right panel D:\Backup\
${leftfocuspath} Full path to item in focus in the left panel C:\Documents\report.doc
${rightfocuspath} Full path to item in focus in the right panel D:\Backup\archive.zip
${leftfocusname} Name of item in focus in the left panel report.doc
${rightfocusname} Name of item in focus in the right panel archive.zip
File Selections
${selectedfiles} Names of all currently selected files and folders file1.txt file2.doc folder1
${selectedfilepaths} Full paths to all currently selected files and folders C:\folder\file1.txt C:\folder\file2.doc C:\folder\folder1
${currentfilepath} Current file path in per-file processing (used with "Run Separately" option) C:\folder\current-file.txt
Date and Time
${date:<format>} Current local date with custom formatting ${date:yyyy-MM-dd} → 2024-03-15
${time:<format>} Current local time with custom formatting ${time:HH:mm:ss} → 15:23:01
Command Parameters
${param:<num>} Script parameter where <num> is the parameter index (0-based) ${param:0} → "first parameter"
${param:1} → "second parameter"
System Information
${pid} Process ID of the Multi Commander instance 1234
${mctemp} Root temporary folder used by Multi Commander C:\Users\username\AppData\Local\Temp\MultiCommander\
Multi Commander Installation Paths
${mcinstallpath} Path from which Multi Commander is running C:\Program Files\MultiCommander
${mcappdatapath} Path to Multi Commander's application data folder C:\Users\username\AppData\Roaming\MultiCommander\
${mclogpath} Path to Multi Commander's log folder C:\Users\username\AppData\Roaming\MultiCommander\Logs\
${mcconfigpath} Path to Multi Commander's main configuration folder C:\Users\username\AppData\Roaming\MultiCommander\Config\
${mcuserappdata} Path to Multi Commander's user data storage for plugins and extensions C:\Users\username\AppData\Roaming\MultiCommander\UserData\
Installation Path Dependencies

Multi Commander path tags (${mc*}) reflect your installation type: Single User, Multi User, or Portable installation, automatically adapting to your configuration.

Practical Usage Examples

These comprehensive examples demonstrate how to use MultiTags effectively across different command types and scenarios, showing the power of dynamic context integration.

Custom Commands
Basic Panel Navigation
MC.Explorer.Goto PATH="${focusfilepath}"

Navigate to the location of the currently focused item

Advanced Search Operation
MC.FileSearch.Search SEARCHIN="${sourcepath}" SEARCHFOR="*.${param:0}" AUTOSTART

Search for files by extension in current source path using command parameter

Dynamic Archive Creation
MC.Filesystem.PackFiles FILES="${selectedfilepaths}" TARGET="${targetpath}${date:yyyy-MM-dd}.zip"

Create timestamped archive of selected files in target directory

External Commands
Open File in External Editor
"C:\Program Files\Notepad++\notepad++.exe" "${focusfilepath}"

Open currently focused file in Notepad++

Folder Comparison Tool
"C:\Program Files\Beyond Compare 4\BCompare.exe" "${leftpath}" "${rightpath}"

Compare left and right panel contents with Beyond Compare

Git Repository Operations
"C:\Program Files\Git\bin\git.exe" add "${selectedfilepaths}"

Add selected files to Git staging area

Batch Script Examples
Smart Backup Script
@echo off
set BACKUP_NAME=${param:0}
if "%BACKUP_NAME%"=="" set BACKUP_NAME=Backup
mkdir "${targetpath}\%BACKUP_NAME%"
xcopy "${sourcepath}\*" "${targetpath}\%BACKUP_NAME%\" /s /e /h
echo Backup completed: %BACKUP_NAME%

Usage: Create organized backup with optional custom name parameter

File Processing with Timestamp
@echo off
set LOGFILE="${targetpath}\process_${date:yyyy-MM-dd}_${time:HH-mm-ss}.log"
echo Processing started at ${date:yyyy-MM-dd} ${time:HH:mm:ss} > "%LOGFILE%"
for %%f in (${selectedfiles}) do (
    echo Processing %%f >> "%LOGFILE%"
    copy "%%f" "${targetpath}\" >> "%LOGFILE%"
)

Usage: Process selected files with detailed timestamped logging

Development Workflow Integration
@echo off
cd /d "${sourcepath}"
echo Building project in %CD%
dotnet build --configuration Release
if %ERRORLEVEL%==0 (
    echo Build successful - deploying to "${targetpath}"
    xcopy "bin\Release\*" "${targetpath}\" /s /e /y
) else (
    echo Build failed - check output
)

Usage: Build project in source directory and deploy to target on success

MultiScript Integration Examples
Correct MultiScript Context Access
// CORRECT - Using dedicated functions
@var $sourcePath = GetSourcePath();
@var $targetPath = GetTargetPath();
@var $focusFile = GetSourceFocusPath();

// CORRECT - Using GetTagValue function  
@var $selectedFiles = GetTagValue("selectedfiles");

// CORRECT - MultiTags in Custom Command calls
MC.Run CMD="notepad.exe" ARG="${focusfilepath}"

Usage: Proper methods for accessing context in MultiScript

Incorrect MultiScript Usage
// INCORRECT - Direct MultiTag assignment does NOT work
@var $path = "${sourcepath}";  // This will NOT resolve
@var $file = "${focusfilepath}"; // This will NOT work

Note: MultiTags cannot be used directly in MultiScript variable assignments

Best Practices and Guidelines

Follow these essential practices to use MultiTags effectively and avoid common pitfalls that can cause command failures or unexpected behavior.

Critical Requirements
Path Quoting Requirements
  • Always Quote Paths: MultiTags are NOT automatically quoted
  • Space Handling: Paths containing spaces will break commands without quotes
  • Special Characters: Paths with ampersands, parentheses need proper quoting
  • Consistent Practice: Quote all path-based tags even if not immediately necessary
Correct Quoting Examples
✅ Correct
"${sourcepath}"
"${focusfilepath}"
"${selectedfilepaths}"
❌ Incorrect
${sourcepath}
${focusfilepath}
${selectedfilepaths}
Safety and Testing
Testing Strategies
  • Test Different Contexts: Verify commands work with various file selections
  • Edge Cases: Test with empty selections, special file names
  • Path Variations: Test with short paths, long paths, network paths
  • Character Sets: Test with international characters and symbols
Error Prevention
  • Validation Logic: Add checks for empty or invalid tag values
  • Fallback Values: Provide default values when tags might be empty
  • User Feedback: Include error messages for failed operations
  • Documentation: Document expected behavior and limitations
Command Debugging
  • Echo Commands: Use echo to display resolved tag values
  • Log Output: Create logs showing tag resolution
  • Step-by-Step Testing: Test individual components before combining
  • Context Verification: Ensure commands work in intended contexts
MultiTags Mastery

Master MultiTags by understanding their role as dynamic context bridges between Multi Commander's file management state and User Defined Commands. Always quote path-based tags to handle spaces and special characters, choose appropriate tags for your command's purpose, and test commands thoroughly with different file selections and path scenarios. Remember that MultiTags transform static commands into dynamic, context-aware automation tools that adapt intelligently to user actions and current workspace state. For MultiScript integration, use GetTagValue() function or dedicated context functions instead of direct tag assignment.

Related Documentation

Enhance your MultiTags knowledge with related command documentation: User Defined Commands Overview, Custom Commands, External Commands, Batch Scripts, MultiScript, and GetTagValue() Function.