Add your commands to the Windows Explorer
The Windows command prompt offers dozens of advanced commands that allow experts to manage the functions for manipulating files or more advanced and complex than those allowed by Windows.
For example, Windows offers no simple function to list all at once the contents of a folder and its subfolders to get a paper printout of the contents of this directory. However, such an operation is quite simple as the command prompt.
Here's how to add an option "List content" in context menu of Windows Explorer.
- Open the Start menu and type Regedit in the search box (in XP run Regedit by selecting Run from the Start menu).
- Deploy the key HKEY_CLASSES_ROOT\Directory\Shell
- Right click on Shell in the tree from left
- Select New Key, and then give the key name "List content" (without quotes)
- Select the key created above in the tree then click the right mouse button and then select New Key. Give this key a name "command".
- Click the "command" key and thus created in the right list, double-click (default)
- Enter the following command:
Code:
cmd /c "cd /d %1 && dir /N /L /S /-C >%TEMP%tmplist.txt && notepad %TEMP%tmplist.txt
- Open Windows Explorer
- Right click on a folder and note the emergence of the "List Content"
- The contents of the directory is listed in Notepad. There is more than demand printing.
Note:
This trick is mainly based on the DIR command to list the files. You can use any other commands for other operations. You can also use other parameters of DIR for a file format other than the one proposed here.
For example:
- The following will list just the files in the directory (without subdirectories)
Code:
cmd /c "cd /d %1 && DIR /B >%TEMP%tmplist.txt && notepad %TEMP%tmplist.txt
- The following command will list files and directories on 3 columns
Code:
cmd /c "cd /d %1 && DIR /W /S >%TEMP%tmplist.txt && notepad %TEMP%tmplist.txt
Bookmarks