Wednesday, July 07, 2004

Running Batch files on a selected Folder in Explorer

Configuring Windows Explorer - Context Sensitive Menus

Great way to run a Batch file on a particular directory.
Eg. Say you want to run a batch file after right-clicking on a Folder, so it is performed on that folder.

  1. Go to Explorer --> Tools --> Folder Options --> File Types
  2. Select the "File Folder" file type
  3. Select Advanced --> New...
  4. Action = Moved to Fixed
  5. Application to use = cmd.exe /c cd "%1" | C:\fixed_dir.bat

This runs fixed_dir.bat file in the currently selected folder and exits the DOS window straight away.
In this case fixed_dir.bat contains:

mkdir Fixed
move *.jpg Fixed

No comments: