Computing Center

  1. Home
  2. Electronics & Gadgets
  3. Computing Center
A shortcut makes multiple folders; change your 'Open With' list; spiff up your Command Prompt.

The Quickest Way to Make Several Folders at Once

Send your Windows-related questions and tips to scott_dunn@pcworld.com. Windows Tips pays $50 for each published item. Click here to read recent Windows Tips columns. Scott Dunn is a contributing editor for PC World.

Last June I explained how to place a shortcut in your right-click menu that creates a new folder. It's a handy technique, but it works only one folder at a time--a limitation that also applies to the BxNewFolder freeware I described in last August's column.

Creating several folders at once--including subfolders within those new folders--requires only a very simple three-line batch file and (sometimes) a quick fix of a Windows bug. To create the batch file, open Notepad or your favorite text editor, and on the first line, type @echo off. Press <Enter>, and on the second line, type set /p name="Type folder name(s): ". (Be sure to use straight "typewriter" quotes. If you're using Notepad, you should get straight quotation marks automatically.) When you run the batch file, this line prompts you to type one or more names for your new folders and stores them in the variable 'name'. Press <Enter> again, and on the third and final line of the batch file, type md %1\%name%, and press <Enter> one more time. This line will create the new folder (via the 'md' or 'make directory' command) in the current folder (%1\) using the items that you entered and stored inside the variable (%name%). Choose File, Save, navigate to a folder in which you store your batch files (such as 'c:\batch'), type a name like make_dir.cmd, and click Save.

To add your batch file to the right-click menu for folders, open a folder or Explorer window (pressing <Windows>-E is one way) and choose Tools, Folder Options, File Types. Scroll through the list of registered file types and select File Folder. Click Advanced to open the Edit File Type dialog box, and choose the New button. For 'Action', type the command name that will appear on your context menu, such as Make Many Folders. For 'Application used to perform action,' type the complete file path and name of your batch file followed by a space and "%1"--for example, e:\apps\batch\make_dir.cmd "%1" (your path and file name may differ). Click OK twice and Close to return to Explorer.

Unfortunately, if you make a mistake while entering text in the New Action dialog box, you have to use the Registry Editor to fix it. To be safe, create a backup of your Registry first (go to "Step-By-Step: Care and Feeding of the Windows Registry" for instructions). With your Registry backed up, choose Start, Run, type regedit, and press <Enter>. In the tree pane on the left, navigate to and double-click HKEY_CLASSES_ROOT\Directory\shell. Select the folder with the name of the command you just added (for example, 'Make Many Folders'), double-click the (Default) icon in the right pane to open the command line in the Edit String dialog box, and make any corrections. To delete your custom command altogether, close the dialog box, right-click the folder in the left pane, choose Delete, and click Yes to confirm the change. For more details, go to "Remove Unsolicited Junk From Your Context Menus" and scroll down to "Resort to Regedit" in my December 2004 column.

Windows Bug Alert! When you create this shortcut in Windows XP (and any other time you open the Edit File Type dialog box in that OS), a bug is likely to change what happens when you double-click a folder. The problem is easy to fix, but it requires editing the Windows Registry. Click here for instructions from last August's column.

Now when you want to make one or more folders (including folders nested within folders), right-click any folder and choose Make Many Folders (or whatever you named your command; see FIGURE 1


FIGURE 1: Get new folders on demand by adding this command to your context menu.

). A command-prompt window will appear asking for the names of your new folders. Type each name separated by a space. If you want your folder names to include spaces, put the names in quotation marks. To make a folder within a folder, type a backward slash (\) between the folder name and the name of its nested folder. When you're done, press <Enter> to create all the folders. For example, type 01-Jan\Draft 01-Jan\Final 02-Feb\Draft 02-Feb\Final 03-Mar\Draft 03-Mar\Final and press <Enter> to create the folders that are shown in FIGURE 2


FIGURE 2: Two clicks and a little typing is all it takes to make several folders at one time.

. Select the parent folder and press * on the numeric keypad to quickly expand all the branches in the tree pane as shown in the figure.

Folder Fodder

Reader Eric King, who contacted me via e-mail, describes an alternative way to create multiple folders. Right-click in the folder in which you want the new folders to appear and type W, F. Repeat the steps, and Windows will name the folders in numbered order, so there's no need to name each folder as you make it (see FIGURE 3


FIGURE 3: Make multiple folders in a flash by right-clicking in the folder and typing two keyboard shortcuts.

). Sure, you'll likely want to rename them eventually, but this is a quick way to get started.

Clean Up 'Open With'

How do I remove programs from the list that appears when I select the Open With, Choose Program option in my right-click menu?

Dave Beauregard, Wareham, Massachusetts

First, let's note that Windows makes it easy to add a program to those listed in the Open With submenu of your context (right-click) menu: All you need to do is right-click the document, select Open With, Choose Program, pick the program from the list, and click OK. Your choice will be on the Open With submenu the next time you right-click that file type.

Removing an item from the list of Open With programs requires editing the Windows Registry; as in the first tip, start by backing up your Registry, following the same "Step-By-Step" instructions.

Once the backup is complete, choose Start, Run, type regedit, and press <Enter> to open the Registry Editor. Navigate in the left pane down to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.

If necessary, click the + (plus sign) next to the FileExts key to expand the branches beneath it. Next, click the + beside the key representing the file extension for the menu you want to edit. Select the OpenWithList key under the extension key.

In the pane on the right side, select the icon that corresponds to the menu item you would like to remove from your context menu. (Note that you won't see the menu item by name, but rather the name of the file that the menu item launches.) Right-click it, choose Delete (or just press the <Delete> key on your keyboard), and click Yes (or press <Enter>) to confirm (see FIGURE 4


FIGURE 4: Clean up your 'Open With' menu by altering the Windows Registry.

).

The next time you right-click a file and choose the Open With shortcut, only the program options you decided to have there will be presented to you. If only it were this easy to throttle back all of Windows' runaway menus!

Supercharge Your Command Prompt With PromptPal


A PromptPal screen.

Last September's column covered the hidden power of Windows' command line. Trouble is, the dark and dire Command Prompt window can intimidate those folks who have grown accustomed to a graphical interface. Addressing that need is PromptPal, a $30 shareware program that gives the Command Prompt basic word-processing conventions such as copy and paste and drag-and-drop. As you type, PromptPal's autocomplete feature shows a list of available commands, as well as command lines that you've entered recently. For example, when you type a / to add a command-line switch, you get a pop-up display of available switches and helpful information about each one. You can launch PromptPal (or switch its current directory) from any folder via a right-click command. PromptPal can even add a command box to the taskbar, which lets you combine the best features of the command-line window with Windows' own Start, Run options. To get a complete rundown of the utility's features, visit www.promptpal.com. Click here to download the 30-day trial version of the program.

Explore Computing Center

About.com Special Features

Essential Laptop Accessories

If you're traveling with your laptop, these 12 items are indispensible. More >

How to Buy a BlackBerry

Sleek and trim or loaded with extras? Select the right smartphone for your lifestyle. More >

Computing Center

  1. Home
  2. Electronics & Gadgets
  3. Computing Center
  4. PCW
  5. Products
  6. Consumer Advice
  7. Tips & Troubleshooting
  8. Windows Tips
  9. The Quickest Way to Make Several Folders at Once

©2009 About.com, a part of The New York Times Company.

All rights reserved.