Question
The Windows operating system contains a built-in command line interpreter that makes it possible for end-users to create simple (and sometimes not so simple) program
The Windows operating system contains a built-in command line interpreter that makes it possible for end-users to create simple (and sometimes not so simple) program scripts in order to automate routine tasks. Your textbook and the article The Command Line Interpreter in Windows (located in your course module) explain a little about how commands are entered and executed in an interpreted language. When you run the command line interpreter (CMD.EXE), the system opens the command window so that you can enter the commands, one-by-one. Each time that you press the enter key, the system executes the line that you just typed.
Working in a command line might seem a little clumsy for someone who is used to using the Windows GUI interface. Some repetitive tasks, such as adding users to a computer or emptying and deleting a group of directories, may be easier to accomplish using the scripting abilities built into cmd.exe.
Practice the commands contained in the article and view the video Creating Batch Files using the Command Interpreter located in your module. Once you have completed this exercise, answer the following questions:
- In the Windows GUI, the term folders is used to refer to the directory structure on the disk storage. What are the CLI commands to create and delete a disk directory? What commands list the contents of a directory on the screen?
- Windows CLI has a built in help feature. Use the help feature to find out what functions are available using the XCOPY command. Which option switches would you use if you wanted to copy the contents of a directory, including all of the subdirectories and files, and to suppress the display of the filenames while copying the files and directories?
- Practice the batch file commands that are illustrated in the module. Make a new folder in your documents directory named Test1. Download the three test files that are included with this activity. Place the files in the new directory Test1.
- Create a simple batch file in Notepad that does the following tasks:
- Start with the command that suppresses the display of the execution of each batch file command.
- Enter the command to create a new directory named Test2 in your documents directory (remember that you should always specify the complete path from the root of the drive to the new directory location).
- Use the XCOPY command to copy the files from the Test1 directory into Test2. What might be some other commands that you could use to copy or move the contents of Test1 to Test2?
- Enter the command to output the list of files contained in Test2 to a file named List2.txt.
- Save the batch file as a text file named MyBatch.bat.
- Submit the answers to the questions and a copy of your batch file and the List2.txt file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started