The first Recovery Console tools that we’ll explore and those associated with managing files and navigation functions. These commands will seem familiar to command-line users, but knowing them is critical when it comes to navigating between directories, removing directories, and renaming files.
Let’s begin with a look at navigation. The cd command is used to change directories, for example cd \cmdcons will move you into the \cmdcons directory. The chdir command is also used to change directories, but only within system folders. For example, to switch from C:\Windows to the system32 folder, the correct command would be chdir system32. Play around with these commands a bit and you may notice that the Recovery Console is actually less concerned with which command you use in most cases. If your screen is becoming cluttered and you need a little room, use cls to clear the screen. As you might expect, the dir command will provide you with a standard listing of the contents of a folder.
If you need to delete a file, you’ll need to be familiar with the del and delete commands. The del command is used to delete a file outside of a system directory, while the delete command is used to delete files within system directories. The ren command renames a file outside of system directories, while the rename command is used within. The md command allows you to create new directories in non-system directories, while mkdir handles the task within. Finally, rd removes a non-system directory, while rmdir handles the task for system folders. If you find these dual-commands confusing, remember that the longer version is always used with system directories (such as %systemroot%), while the shorter command is used for all non-system folders.
The attrib command is almost identical in function to its normal command-line counterpart. This utility allows you to add or remove attributes from a file when necessary, including read-only, system, hidden, and compressed. A common use of this command is to remove the read-only attribute from a file you have copied from a CD, with a syntax of attrib –R filename. When in doubt about syntax, always head back to the command name following by /? for help and details.
If you want to view the contents of a text file, you have the choice of using either the more or type command. This will display the contents of the file onscreen, but unfortunately will not allow the contents of the file to be edited. No text editing tools are provided with the Recovery Console. If you need to change the contents of a text file, you’ll need to create it (or copy it) from another system, and then copy the file to the Recovery Console from a floppy disk or CD. A bit of a pain we know, but simply a reality of the environment.
Two of the most useful Recovery Console file tools are the copy and expand commands. The copy command is very much what you’d expect, allowing you to copy files within accessible directories, or from a removable disk (if enabled via the set command, which is explored later in this article). The expand command is useful when a file has been corrupted and you want to copy over the compressed version from the Windows XP installation CD.