CompTIA A_ Certification All-In-One Exam Guide, Seventh Edition - Michael Meyers [251]
Program Files
09/12/2008 08:32 PM 21 statusclient.log
07/31/2008 10:40 PM 153 systemscandata.txt
03/13/2009 09:54 AM 1,111,040 t3h0
04/21/2007 04:19 PM
temp
07/12/2008 10:18 AM
WINDOWS
3 file(s) 1,111,214 bytes
294,182,881,834 bytes free
What about uppercase and lowercase? Windows supports both, but it interprets all commands as uppercase. Use the MD command to make a folder called steam (note the lowercase) and see what happens. This also happens in the graphical Windows. Go to your Desktop and try to make two folders, one called STEAM and the other called steam, and see what Windows tells you.
To create a FILES subdirectory in the STEAM directory, first use the CD\ command to point the prompt to the STEAM directory:
CD\STEAM
Then run the MD command to make the FILES directory:
MD FILES
Make sure that the prompt points to the directory in which you want to make the new subdirectory before you execute the MD command. When you’re finished, type DIR to see the new FILES subdirectory. Just for fun, try the process again and add a GAMES directory under the STEAM directory. Type DIR to verify success.
Removing Directories
Removing subdirectories works exactly like making them. First, get to the directory that contains the subdirectory you want to delete, and then execute the RD (or RMDIR) command. In this example, let’s delete the FILES subdirectory in the C:\STEAM directory. First, get to where the FILES directory is located—C:\STEAM—by typing CD\STEAM. Then type RD FILES. If you received no response from Windows, you probably did it right! Type DIR to check that the FILES subdirectory is gone.
The plain RD command will not delete a directory in Windows if the directory contains files or subdirectories. If you want to delete a directory that contains files or subdirectories, you must first empty that directory by using the DEL (for files) or RD (for subdirectories) command. You can use the RD command followed by the /S switch to delete a directory as well as all files and subdirectories. RD followed by the /S switch is handy but dangerous, because it’s easy to delete more than you want. When deleting, always follow the maxim “Check twice and delete once.”
Let’s delete the STEAM and GAMES directories with RD followed by the /S switch. Because the STEAM directory is in the root directory, point to the root directory with CD\. Now execute the command RD C:\STEAM /S. In a rare display of mercy, Windows responds with the following:
C:\>rd steam /s
steam, Are you sure (Y/N)?
Press the Y key and both C:\STEAM and C:\STEAM\GAMES are eliminated.
Running a Program
To run a program from the command line, simply change the prompt focus to the folder where the program is located, type the name of the program, and then press the ENTER key on your keyboard. Try this safe example. Go to the C:\WINNT\System32 or C:\WINDOWS\ System32 folder—the exact name of this folder varies by system. Type DIR /P to see the files one page at a time. You should see a file called MEM.EXE (Figure 15-14).
Figure 15-14 MEM.EXE displayed in the System32 folder
As mentioned earlier, all files with extensions .EXE and .COM are programs, so MEM.EXE is a program. To run the MEM.EXE program, just type the filename, in this case MEM, and press ENTER (Figure 15-15). Note that you do not have to type the .EXE extension, although you can. Congratulations! You have just run your first program from the command line.
Figure 15-15 Running MEM in Windows Vista
* * *
NOTE Windows includes a lot of command-line tools for specific jobs such as starting and stopping services, viewing computers on a network, converting hard drive file systems, and more. The book discusses these task-specific tools in the chapters that reflect their task. Chapter 23, “Local Area Networking,” goes into detail on the versatile and powerful NET command, for example. You’ll read about the CONVERT command in Chapter 26, “Securing Computers.” I couldn’t resist throwing in two of the more interesting tools, COMPACT and CIPHER, in the Beyond A+ section