DOS lives! Secrets of the Windows command prompt

Don't be afraid of a little typing. Lots of good old DOS commands still work in Windows, and often they're the best choice for quick and efficient work.

1 2 3 4 5 6 7 8 Page 3
Page 3 of 8

Working with groups of files

clear.gif

I most often open a command prompt window when organizing files. Because I was weaned on DOS, I name my files in clever and consistent ways to take advantage of the various text-mode file-manipulation commands.

To make that happen, I name certain files with a special prefix or suffix -- files with images of my kids all start with their names, for example, and files that pertain to a specific event like a birthday or holiday all use the same word as a suffix -- for example, (jonah_filename_birthday).

That naming system may do nothing in Windows, but in text mode, it allows you to easily gather specific files and treat them as a unit.

Of course, clever naming isn't enough. To work with groups of files, you also need to know and use DOS's filename wild cards. There are two: ? for single characters and * for a group of characters. When you combine the wild cards to represent any character with consistent parts of a filename, you can then manipulate those specific files as a group.

Copying files

For example, say I have a folder full of 100 pictures. Some of them have the word "birthday" in the filename. To copy those birthday files to a USB flash drive using drive letter L, I type the following command:

COPY *BIRTHDAY* L:

The COPY command above automatically plucks out or selects any file with the word BIRTHDAY in it, anywhere in that directory. The * represents any text, that is, any characters, before or after the word BIRTHDAY in the file, so it will select both (jonah_birthday) and (birthday_2006). And the L: represents drive L, the flash drive to which I'm copying the files.

Creating subdirectories and moving files to them

Here's another example, typical of my digital housekeeping. Say I have a huge directory for a project. It started out small, then grew a bunch of files.

To keep them organized, I create separate folders for text, graphics and e-mails. I then use the MKDIR command to create new directories, actually subdirectories in the current directory, like so:

MKDIR PICS

The above command creates the subdirectory PICS -- a lot faster than summoning and naming a new folder in Windows. Then to move the image files into that directory, I use the following three commands:

MOVE *.JPG PICS
MOVE *.TIF PICS
MOVE *.PNG PICS

These three commands empty the current directory of its graphics files, all JPG, TIF and PNG images. The files are moved to the PICS directory, which is a subdirectory of whichever directory I'm currently logged to.

Sharing files
Say you want to share a file. The environment variable for Windows' Public folder is named, logically, PUBLIC. To copy the movie file SIMON.WMV to that folder, use this command:

COPY SIMON.WMV %PUBLIC%

If SIMON.WMV isn't in the current folder, then you'll have to use CD to log to the proper folder and then issue the command, or stay where you are and specify a pathname to the file, like so:

COPY VIDEOS\SIMON.WMV %PUBLIC%\VIDEOS

Along with MOVE and COPY, DOS sports the ERASE (or DEL) and RENAME commands, which are used to remove and rename files, alone or in groups.

clear.gif
clear.gif
1 2 3 4 5 6 7 8 Page 3
Page 3 of 8
7 inconvenient truths about the hybrid work trend
Shop Tech Products at Amazon