Requirements of all batch files created in this assignment ...

[Pages:3]CIS106 ? Homework #1

Requirements of all batch files created in this assignment and future assignments: ? Create a directory on your disk named batchfiles and store all batch files created in this assignment within

that directory. ? The email server at BCC will not allow .BAT files to be received as attachments. For this reason, you are

required to send all batch files created in this assignment in one zipped file. Zip the BATCHFILES directory (which should contain all your batch files) and send me the zipped file. If you don't know how to ZIP files, refer to the instructions provided on the course website ? supplemental materials page - for zipping and unzipping files. (If you're using gmail, you will need to remove the extensions on the batch files before zipping them. I'll add the extension back when I receive the files.) ? For each batch file, in addition to including it in the zipped file, you must copy the text from the batch file into your Word document as part of the answer to that problem. ? You must also provide a sample execution of the batch file ? I need to see the command you used to run the batch file and its output ? copy all that text from the command prompt and paste it into your Word document. ? You should submit two files; the word processing document and the zipped file containing the batch files. ? Each batch file must include documentation which includes (at a minimum) your name, the file's name and the general purpose of the batch file. ? Use the messaging recommendations discussed in class ? remember to use @echo off -- keep your output `clean'. ? Please note that when reading each of the below problems, when words within either the instructions for the problem or within the sample output are displayed in italics, you are required to use an environment variable for that value ? If you don't know what I'm looking for ? ask before submitting! ? Almost every one of these problems will require the use of piping to find .... if you're rusty on how it's used, you should review that before doing the homework.

Please remember to number each of your answers with the respective problem number.

1) Create a batch file named message.bat. It must display a message similar to the one displayed below. Be sure to use environment variables and commands where appropriate and include spacing and formatting as presented here. The version of windows and the ip address should be specific to the machine you're using, not what's displayed below. The OS Name should be extracted from the systeminfo command's output. Please do not just display all constants; the output for this batch file should be different whenever run by a different user on a different computer.

Sample Execution: C:\batch\>message

Hello john, you are currently logged in at computername It is 12:20:49.92 on Wed 12/27/2017 You are using a computer which is currently running:

OS Name:

Microsoft Windows 7 Enterprise

The IP Address on your system is:

IPv4 Address. . . . . . . . . . . . : 192.168.1.101

2) Use one of your Vmware machines to complete this problem as well as for problem #3 and problem #4. Create three local users using the net user command. Each user must have a username, a password and full name (first and last name). Their username should be the first letter for their first name followed by their last name. (i.e., mine would be JArruda) As your answer to this question include the commands used to create the users as well as a net user username command (with output) for each user created.

3) Create a batch file named Userinfo.bat. The batch file must display information about a specific user account that exists on the computer. The output message must include the user's name, full name, the date the user's password was last set as well as the computer name and the current date and time. A sample execution is provided below.

The user's name must be provided by you at the time the batch file is executed (a replaceable parameter must be used). The message must be formatted similar to the message presented below. A minimum of 4 lines of output. You must complete the sample executions while logged in as the CIS106Student account and you must present information for at least one of the users you created in question 2.

Sample Execution:

C:\>userinfo john

The john user exists locally on the Win7-Client computer. His full name is:

Full Name

John Smith

As of 11:50:57.21 on Wed 12/27/2017, the last time john's password was set was:

Password last set

12/27/2017 11:39:12 AM

4) Modify the batch file created in problem 3. Name this one UserInfolog.bat. Instead of displaying the output to the screen, redirect all output to a file. The file name must be named computername.log and it must be created each time the batch file is executed. After redirecting the output to the log file, the batch file must display that file's contents in the command prompt screen. As part of your answer for this problem, include the log file as an attachment. Please note that in the end, the output to this one will look the same as the output from the userinfo.bat file created in problem 3 but instead of going directly to the screen the output will be stored in a text file and the batch file will include the command to display the file's contents within the command prompt window.

5) Create a batch file named pcinfo.bat that displays the value for each of the items listed in the sample output. All the information can be obtained from the systeminfo command. The systeminfo command generates LOTS more than what's provided below; the objective of this problem is to extract just the lines of information listed below.

SAMPLE OUTPUT:

Host Name:

Win7-client

OS Name:

Microsoft Windows 7 Enterprise

Registered Owner:

ITS

Original Install Date:

1/20/2017, 1:19:32 PM

Time Zone:

(UTC-05:00) Eastern Time (US & Canada)

Total Physical Memory: 2,048 MB

Available Physical Memory: 589 MB

The batch file must redirect its output to a file named . This file must be created each time the batch file is executed. After all output is redirected to the .info file, the batch file should clear the screen, and the batch file must display that file's contents on the screen. As part of your answer for this problem, include the .info file as an attachment.

6) Ensure that your batchfiles directory is automatically included in the search path every time you open a command prompt window. There is more than one way to do this; the approach you take is up to you. Your answer to this question must be a step-by-step explanation (bulleted or numbered list) of the exact approach you took to complete this task. You must also provide an explanation of exactly how you tested this to make sure it worked. (Note: viewing the revised search path does not test it.) If you use a batch file to complete this problem you must, in addition to setting the search path within the batch file, clear the screen and you must include the content of the batch file as part of your answer. If you change system properties to complete this problem you must provide screenshots to confirm your settings. In either case, assume I do not know how to do this and that I will follow your instructions to complete the steps.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download