How to Cheat at Windows System Administration Using Command Line Scripts

As an administrator, you cannot escape from regular network file and folder maintenance tasks, even though these tasks are easy enough for normal users or help desk employees to perform. You may be required to maintain files and folders on servers and other critical computers on the network, including yours, that nobody else can handle. Many of the tasks related to file and folder maintenance are very easy, and although you can handle them using graphical user interfaces (GUIs) such as Windows Explorer, you may find that using GUIs is very time-consuming and that using the command line is a better option. Moreover, when you want to streamline your administrative jobs by using batch files, you will definitely need to know how to create files and folders using simple commands and how you can use these commands in your batch files or scripts.
This chapter discusses the commands you can use for everyday file and folder maintenance tasks. You might already be familiar with several of them, but you might not be aware of their complete functionality. This chapter begins with a discussion on using wildcards in filenames, and explains file and folder attributes as well as some of the common commands used to copy, move, and delete files. You can use certain commands, such as Xcopy, with both...