Custom Commands - Examples
Examples of Custom commands
- Set View filter for the Explorer Panel
- Select files and folder in the Explorer Panel
- Run an external program
- Pack Files
- Search For Files
Set View Filter
Set a filter to determine which files and/or folders are visible in the Explorer Panel:
MC.Explorer.SetViewFilter FILTER="*.jpg"
MC.Explorer.SetViewFilter FILTER="*.jpg *.gif *.png *.tiff"
Exclude folders named ".svn":
MC.Explorer.SetViewFilter FILTER="-/.svn"
Select Files and Folders
Select files and/or folders in the Explorer Panel:
MC.Explorer.Selection.Select FILTER="*.jpg *.png"
Run Application
Run an External Application:
MC.Run CMD="Notepad.exe"
Run an Application with Parameters:
MC.Run CMD="Notepad.exe" ARG="C:\myFile.txt"
Run an External Application as Administrator:
MC.Run CMD="Notepad.exe" ADMIN
Let Windows decide how the file should be opened. In the example below, Windows will open it in your default browser:
MC.Run CMD="http://www.google.com" SHELL
Run external application with the file in focus as argument:
MC.Run CMD="MyApp.exe" ARG="${focusfilepath}"
MC.Run CMD="MyApp.exe" ARG="-a -f -i:${focusfilepath}"
Pack Files
Pack all files in "D:\MyFiles" using zip into a file named Backup.zip in the target location:
MC.Filesystem.PackFiles FILES="D:\MyFiles\*.*" METHOD="Zip" TARGET="${targetpath}Backup.zip"
Pack all files in "D:\MyFiles" using zip into a file named "Backup-2010-03-10-12:22:22.zip" and store the file in the current target location. The date and time will be the date/time at the moment the command is run:
MC.Filesystem.PackFiles FILES="D:\MyFiles\*.*" METHOD="Zip" TARGET="${targetpath}${date:yyyy-MM-dd}-${time:hh:mm:ss}.zip"
Search for Files
Find all *.jpg and *.tiff files in the current source path; do not search in the ".backup" folder; auto-start the search when the command is run;
MC.FileSearch.Search SEARCHIN="${sourcepath}" SEARCHFOR="*.jpg *.tiff" EXCLUDE=".backup" AUTOSTART