___________________________________________________________________________
IX 520002 Platforms and Devices
Batch File Assessment
___________________________________________________________________________
Study Block 2: 07/02/2022 to 15/04/2022
Reports due: 18 March 2022.
Submission: Upload soft copy to Moodle.
Course Leader: Reza Rafeh
Weighting/Contribution: 10% to final mark
Marks out of: 100 marks
Learning outcomes covered: LO 1
Version: 2022.1
__________________________________________________________________________________
Platforms and Devices Block 1, 2022
Assessment Task: Batch file
Assessment Overview
Create a batch file that will carry out tasks detailed in this document, on a Windows PC. This
assessment relates to learning outcome 1.
Late Submission, Reassessment, Extensions
The School process in relation to Submissions, Extensions, Resubmissions and Re-sits complies with
Otago Polytechnic Policies. Students can view policies on the Otago Polytechnic Website located at
http://www.otagopolytechnic.ac.nz/.
Resubmission is where an original assessment is returned to the student for minor reworking and
then being resubmitted for final grade. Where a student achieves a D grade for any assessment, an
application for resubmission may be made to the Head of School. A maximum of two resubmissions
will be permitted in any one year for any student.
Resubmissions are completed within a short time frame (usually no more than five working days)
and usually must be completed within the timing of the course to which the assessment relates.
Resubmissions will be available only to students who have made a genuine attempt at the first
assessment opportunity. The maximum grade awarded for a resubmission will be C-.
Information about late submission and extensions can be located in the Course Outline.
Platforms and Devices Block 1, 2022
IX520002 Platforms and Devices
Batch File (worth 10% of final mark)
Due
18 March 2022, 5 pm.
Task
Create a batch file that will carry out tasks detailed in this document, on a Windows PC.
File Headers
At the beginning of the file, insert a text header made up of non-executable comments (there
is a command to do this – look in the HELP list), labelling and describing the following
information on multiple lines:
• The name of the batch file
• A paragraph describing the purpose of the script
• Your name and student ID
• The course name, your year and semester
After the header comment, insert a statement that outputs the file name to the screen (there
is a command to do this – look in the HELP list.)
File Contents
Insert command statements to perform the actions numbered 1 through 20 on the list of
actions given on pages 4 and 5 of this document.
Before each set of command statements referred to above, insert statements that output
to the screen a description of each action that the command statements will perform.
The displayed output of each statement should contain the following information:
• A blank line, to make the output more readable
• A section containing:
o The action number
o The name of the command (or commands) that you have decided to use
o A brief description of what the command is supposed to do (you can copy this
from the list of actions if you wish)
After each action from the list, insert a statement to display another blank line. Then
insert a statement to suspend processing of the script, to enable the examiner to look at
Platforms and Devices Block 1, 2022
the script file’s output before pressing the Enter key to continue (there is a command to
do this – look in the HELP list.)
Throughout the batch file, ensure that the lines within the file are not displayed to the
screen as they are processed (there is a command to control this – look in the HELP list),
except when it is necessary to demonstrate the working of the batch file.
Layout
Ensure that the text within each batch file is laid out neatly and consistently. In particular:
• Use uppercase letters for all command line commands, switches and switch values
• Use consistent lettering for all command line command parameters, such as file names
• Leave blank lines around each section within each file
• Use spaces and tab characters to line up any columns
• Check your spelling, punctuation and grammar throughout
Submission
• Change the file extension of your batch file from .bat to .txt
• Submit using the link on Moodle.
Platforms and Devices Block 1, 2022
Batch File: [YOURNAME].BAT (e.g. SIMON.BAT or JACINDA.BAT)
1. Output a line to the screen that displays your name
2. Create a folder on the root of the C: drive called “My Batch Script File Assignment”
3. Change into the “My Batch Script File Assignment” folder.
4. Create a folder within “My Batch Script File Assignment” called “Input”
5. Create another folder within “My Batch Script File Assignment” called “Processing”
6. Create another folder within “My Batch Script File Assignment” called “Output”
7. List all hidden files in the root directory of the C: drive – output the listing to a file called
“Input Data.txt” in the “Input” subfolder.
(In this assignment, you won’t be using the contents of this file as actual input, but it is
possible to do so.)
8. Make a backup copy of Input Data.txt on the root of the C: drive, and with the same name,
but with extension “.bak”.
9. Go to the root directory of the C: drive
(The command you use here must work the same from whichever drive, folder or subfolder
the script is currently in.)
10. Update the folder search path for batch script file execution to include the “Processing”
subfolder, and then display the folder search path.
(Make sure you preserve the folders that were already in the search path.)
11. Change the command prompt to include the time, the words “Hello World” and the ‘>’
character (to demonstrate this on the screen, you might need to temporarily alter the setting
so that the lines from the batch script file are displayed to the screen as they are processed.)
12. Create a new command window, with red coloured text and green background (to do this,
you will need two commands on the same line; one is CMD – type ‘CMD /?’ for help; the other
command is in the HELP list.)
13. Create another new command window, with blue coloured text and a bright white
background, and with a prompt that includes the Windows version number.
14. List all the folders (not files) in C:\WINDOWS\System32, (or 64-bit equivalent) sorted into
alphabetical order – output the listing to a file called “Batch Script File Output Data.txt” in the
“Output” subfolder.
Platforms and Devices Block 1, 2022
15. List all text files whose names are up to seven characters long on the whole C: drive –
make the listing output in wide format – the listing output must be appended to the end of
“Batch Script File Output Data.txt”
16. Delete folder “My Batch Script File Assignment”, together with all subfolders and their
contents.
17. Output to the screen the configuration information relating to your network settings.
18. Create a local user called “Bob”, then create a local group called “Awesome Users” and
add Bob to it.
19. Delete the group “Awesome Users” and delete the user “Bob”.
20. Create a task to be scheduled at 10 pm every Sunday that will check the C disk for errors
and write the results to a file called “chkdskResults.txt” on the desktop.
Platforms and Devices Block 2, 2020
Batch File Assignment Name: ______________________
Formatting (20 marks)
File Header (10)
Echo off (1)
Name of batch script file (1)
Description of purpose of script (2)
Name and ID (2)
Course Name, Year, Semester (2)
Output File Name to Screen (2)
Question Format (10)
Blank line
Question Number
Name of Command
Brief Description
Pause script
Script (80 marks - 4 marks each)
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 9
Question 10
Question 11
Question 12
Question 13
Question 14
Question 15
Question 16
Question 17
Question 18
Question 19
Question 20
Total Marks (Out of 100)