commands basic
commands basic
Introduction
Tags: A+ Navigation Commands Dir Command-Line Tools
Networking Commands Ipconfig Nslookup Chkdsk Copy Gpupdate
Learning Outcomes
In this module, you will complete the following exercises:
Navigation Commands
The Ipconfig Command
The Ping Command
The Hostname Command
The Netstat Command
https://www.practice-labs.com/app/platform/print.aspx 1/106
12/10/24, 12:53 PM Practice Labs | Print
Exam Objectives
The following exam objectives are covered in this module:
Navigation
Command-line tools
Lab Duration
It will take approximately 1 hour and 30 minutes to complete this lab.
The completion time of this module exceeds our usual 1-hour timeframe.
Please ensure you have taken into consideration how long this module will
take to complete.
https://www.practice-labs.com/app/platform/print.aspx 2/106
12/10/24, 12:53 PM Practice Labs | Print
https://www.practice-labs.com/app/platform/print.aspx 3/106
12/10/24, 12:53 PM Practice Labs | Print
Lab Topology
During your session, you will have access to the following lab configuration.
Depending on the exercises, you may or may not use all of the devices, but they
are shown here in the layout to get an overall understanding of the topology of
the lab.
https://www.practice-labs.com/app/platform/print.aspx 4/106
12/10/24, 12:53 PM Practice Labs | Print
These commands automate tasks by entities such as scripts and batch files. The
nature of the tasks performed is not routine but slightly complex. It is more
related to altering the structure of an operating system rather than merely using
it.
Learning Outcomes
After completing this exercise, you should be able to use:
Navigation Commands
Your Devices
You will be using the following devices in this lab. Please power these on now.
Step 1
Connect to PLABWIN10.
Command Prompt
https://www.practice-labs.com/app/platform/print.aspx 5/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 1.1 Screenshot of PLABWIN10: Displaying selecting Command Prompt from the Best Match pop-up
menu.
Step 2
In the Administrator: Command Prompt window, type the following command:
dir
Press Enter.
This command is used to view the directories and subdirectories inside your
current directory.
https://www.practice-labs.com/app/platform/print.aspx 6/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 1.2 Screenshot of PLABWIN10: Displaying the command to view the directories and subdirectories
entered and executed in the Administrator: Command Prompt window.
Step 3
Clear the Command Prompt window by typing the following command:
cls
Press Enter.
You can also set a directory to be the current directory. Type the following
command and press Enter:
cd downloads
Note: The command will take you to the \Downloads subdirectory in the C
drive.
https://www.practice-labs.com/app/platform/print.aspx 7/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 1.3 Screenshot of PLABWIN10: Displaying the command to navigate to set a directory as the
current directory entered and executed.
Step 4
Notice the command prompt now changes to include the \Downloads
subdirectory. This indicates that you are in the Users>administrator>Downloads
directory.
d:
https://www.practice-labs.com/app/platform/print.aspx 8/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 1.4 Screenshot of PLABWIN10: Displaying the command to navigate to a particular drive entered
and executed.
Step 5
You can view the files and folder of another directory from your current location
by using the dir command. To do this, provide the complete path of the directory
to view.
Press Enter.
The /a parameter, along with the /h attribute, displays all hidden files and
directories in the specified subdirectory.
https://www.practice-labs.com/app/platform/print.aspx 9/106
12/10/24, 12:53 PM Practice Labs | Print
Note: You can clear the Command Prompt window by entering the cls
command.
Figure 1.5 Screenshot of PLABWIN10: Displaying the command to view the files and folder of another
directory from the current location entered and executed.
Note: The number of free bytes displayed in your lab might differ from the
screenshot.
Step 6
Similarly, you can view a specific set of files under a directory, including the
subdirectories.
For example, to view all the executable files in the c:\windows\*.exe directory,
type the following command:
dir c:\windows\*.exe /s /b
https://www.practice-labs.com/app/platform/print.aspx 10/106
12/10/24, 12:53 PM Practice Labs | Print
Press Enter.
Figure 1.6 Screenshot of PLABWIN10: Displaying the command to view a specific set of files under a
directory, including the subdirectories entered and executed.
Note: The /s parameter displays all files with the matching criteria in the
parent and subdirectories. The /b parameter displays only the path and the
file names, which makes the output more readable.
Step 7
To navigate back to the original location, which
was C:\Users\Administrator\Downloads, type the following command:
c:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 11/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 1.7 Screenshot of PLABWIN10: Displaying typing the required command to navigate back to the
original location.
Step 8
Type the following command and press Enter:
cd..
This command moves you up one directory. Notice you are now up onto the
C:\Users\administrator location, which is one level up the from the earlier
C:\users\administrator\downloads directory.
https://www.practice-labs.com/app/platform/print.aspx 12/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 1.8 Screenshot of PLABWIN10: Displaying typing the required command to navigate back to the
original location.
Note: You can clear the Command Prompt window by entering the cls
command.
Leave all devices in their current state and proceed to the next exercise.
https://www.practice-labs.com/app/platform/print.aspx 13/106
12/10/24, 12:53 PM Practice Labs | Print
Learning Outcomes
After completing this exercise, you should be able to use:
Your Devices
You will be using the following devices in this lab. Please power these on now.
Step 1
Ensure you are connected to PLABWIN10 and the Administrator: Command
Prompt window is open.
ipconfig
Figure 2.1 Screenshot of PLABWIN10: Displaying typing and executing the ipconfig command in the
Administrator: Command Prompt window.
Step 2
To view the complete details of the network adapter, type the following
command:
ipconfig /all
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 15/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.2 Screenshot of PLABWIN10: Displaying the command to view the complete details of the IP
addresses on the system entered and executed.
Note: Notice that the output reveals information, such as DNS and DHCP
server IP addresses. A DNS server is required for name resolution. A DHCP
server leases IP addresses to the systems on the network.
Step 3
Type the following command and press Enter:
ipconfig /flushdns
https://www.practice-labs.com/app/platform/print.aspx 16/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.3 Screenshot of PLABWIN10: Displaying the command to clear the DNS cache entered and
executed.
Step 4
To re-register DNS names, type the following command:
ipconfig /registerdns
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 17/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.4 Screenshot of PLABWIN10: Displaying the command to re-register the DNS names entered and
executed.
Step 5
Type the following command and press Enter:
ipconfig /displaydns
https://www.practice-labs.com/app/platform/print.aspx 18/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.5 Screenshot of PLABWIN10: Displaying the command to view the DNS Resolver Cache entered
and executed.
Note: The ipconfig /displaydns command displays the DNS Resolver Cache.
You can scroll up to read the information from the DNS Resolver Cache.
Step 6
Type the following command and press Enter:
ipconfig /?
https://www.practice-labs.com/app/platform/print.aspx 19/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.6 Screenshot of PLABWIN10: Displaying entering and executing the required ipconfig command.
Note: Executing the ipconfig command with the /? parameter displays the
different other options available with this command.
Step 1
Ensure you are connected to PLABWIN10, where the Administrator: Command
Prompt window is open.
https://www.practice-labs.com/app/platform/print.aspx 20/106
12/10/24, 12:53 PM Practice Labs | Print
ping
Figure 2.7 Screenshot of PLABWIN10: Displaying executing the ping command in the Administrator:
Command Prompt window.
Note: All the parameters associated with the ping command are displayed.
Step 2
Type the following command:
ping -n 3 192.168.0.3
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 21/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.8 Screenshot of PLABWIN10: Displaying the command to send a pre-defined number of packets
to the mentioned IP address entered and executed.
Note: Here, the -n parameter is used with the ping command. The -
n parameter sends a pre-defined number of packets to the mentioned IP
address and requests the responses to be returned.
Step 3
You can also ping to the same device with its name. Type the following
command:
ping plabwin11
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 22/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.9 Screenshot of PLABWIN10: Displaying entering and executing the ping command.
In this task, you will use the hostname command to find the name of the virtual
machine being used.
Step 1
Ensure you are connected to PLABWIN10.
hostname
https://www.practice-labs.com/app/platform/print.aspx 23/106
12/10/24, 12:53 PM Practice Labs | Print
Press Enter.
Figure 2.10 Screenshot of PLABWIN10: Displaying entering and executing the hostname command in the
Administrator: Command Prompt window.
Note: Notice within the Practice Labs virtual machine, this machine is
named "PLABWIN10".
Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
https://www.practice-labs.com/app/platform/print.aspx 24/106
12/10/24, 12:53 PM Practice Labs | Print
To view the output of the netstat command without any parameter, type the
following command:
netstat
Press Enter.
Figure 2.11 Screenshot of PLABWIN10: Displaying the output of the netstat command without any
parameter in the Administrator: Command Prompt window.
Note: The netstat command shows all the active Transmission Control
Protocol (TCP) connections and their state.
The Transmission Control Protocol (TCP) connection is a reliable, ordered
delivery of a stream of bytes, which are sent from one system to another
system on the network. It is the core protocol being used in World Wide Web
and applications, such as E-mail. The User Datagram Protocol (UDP) does
not provide reliable data service but utilizes reduced latency.
https://www.practice-labs.com/app/platform/print.aspx 25/106
12/10/24, 12:53 PM Practice Labs | Print
Step 2
Type the following command and press Enter:
netstat -o
Figure 2.12 Screenshot of PLABWIN10: Displaying the command to view the state of the TCP connections
entered and executed.
Note: The netstat command with the o parameter is used to view the state
of all TCP connections with each connection's Process ID (PID). Please note
that the output can vary from what’s displayed on the screenshot.
Step 3
To view the information about a particular protocol, such as TCP, type the
following command:
https://www.practice-labs.com/app/platform/print.aspx 26/106
12/10/24, 12:53 PM Practice Labs | Print
netstat -s -p tcp
Press Enter.
Note: Please note the output will vary from what's shown in the screenshot.
The active connections present will differ at the time this command is
executed.
Step 4
To update the connection statistics every few seconds, such as 5 seconds, type
the following command:
netstat -e -t 5
https://www.practice-labs.com/app/platform/print.aspx 27/106
12/10/24, 12:53 PM Practice Labs | Print
Press Enter.
Figure 2.14 Screenshot of PLABWIN10: Displaying the command to update the connection statistics every
5 seconds entered and executed.
Step 5
Type the following command and press Enter:
netstat -a
https://www.practice-labs.com/app/platform/print.aspx 28/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.15 Screenshot of PLABWIN10: Displaying the command to list all TCP and UDP connections
entered and executed.
Note: The netstat command with the a parameter will list all the TCP and
UDP connections. Notice in the screenshot that there are TCP and UDP
connections.
Step 1
https://www.practice-labs.com/app/platform/print.aspx 29/106
12/10/24, 12:53 PM Practice Labs | Print
You can use the nslookup command without any parameters. Type the following
command and press Enter:
nslookup
For the time being, press the Ctrl+C keys to break the command.
Figure 2.16 Screenshot of PLABWIN10: Displaying executing the nslookup command without any
parameters in the Administrator: Command Prompt window.
Step 2
To find the A record for a domain, type the following command:
nslookup practicelabs.com
https://www.practice-labs.com/app/platform/print.aspx 30/106
12/10/24, 12:53 PM Practice Labs | Print
Press Enter.
Figure 2.17 Screenshot of PLABWIN10: Displaying the command to find the A record for a domain entered
and executed.
Step 3
Type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 31/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.18 Screenshot of PLABWIN10: Displaying the command to find the NS record for a domain
entered and executed.
Note: The above command will find the NS (nameserver) record for a
domain.
Step 4
Next, type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 32/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.19 Screenshot of PLABWIN10: Displaying the command to query the SOA record for a domain
entered and executed.
Note: The above nslookup command entered will query the SOA (Start of
Authority) record for a domain.
Step 5
To find all DNS records for a domain, type the following command:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 33/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.20 Screenshot of PLABWIN10: Displaying the command to find all DNS records for a domain
entered and executed.
Step 6
To use a specific DNS server for a domain, type the following command:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 34/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.21Screenshot of PLABWIN10: Displaying entering and executing the command to use a specific
DNS server for a domain.
Step 7
To perform a reverse lookup from an IP address, type the following command:
nslookup 192.168.0.1
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 35/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.22 Screenshot of PLABWIN10: Displaying the command to perform a reverse lookup from an IP
address entered and executed.
Step 8
Type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 36/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.23 Screenshot of PLABWIN10: Displaying the command to increase the timeout limit entered and
executed.
Note: The above nslookup command will increase the timeout value limit.
Step 9
Type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 37/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.24 Screenshot of PLABWIN10: Displaying the output when using the -debug parameter along
with the nslookup command.
Note: The nslookup command used with the -debug parameter will
generate questions and answers with detailed information.
There are many variations of this command. Each variation allows you to
determine some aspect of your connection with the folder/drive on the network.
In this task, you will learn to use the net use command.
Step 1
https://www.practice-labs.com/app/platform/print.aspx 38/106
12/10/24, 12:53 PM Practice Labs | Print
net use z:
Figure 2.25 Screenshot of PLABWIN10: Displaying the command to view the existing network connection
that has been mapped to a drive letter entered and executed in the Administrator: Command Prompt
window.
Note: You can use the net use command to view the existing network
connection that has been mapped to a drive letter on your system.
Step 2
You can also map a network share or drive to a specific drive letter on your
system. To do this, type the following command:
https://www.practice-labs.com/app/platform/print.aspx 39/106
12/10/24, 12:53 PM Practice Labs | Print
Press Enter.
Figure 2.26 Screenshot of PLABWIN10: Displaying the command to map a network share or drive to a
specific drive letter typed in.
Note: You have mapped the x drive of the local system with the
\\plabwin11\c$ drive. The /persistent parameter can have either a
yes or no value. The value of yes means that the mapping will be available
when you log on to the system next time. The value of no means that the
mapping is limited to this session only.
Step 3
Minimize the Administrator: Command Prompt window.
https://www.practice-labs.com/app/platform/print.aspx 40/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.27 Screenshot of PLABWIN10: Displaying opening File Explorer from the taskbar.
Step 4
In the File Explorer window, on the left pane, scroll down and
verify c$ (\\plabwin11) is now mapped to the drive letter X.
Click on the drive letter X. Notice its contents are displayed in the right pane.
https://www.practice-labs.com/app/platform/print.aspx 41/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.28 Screenshot of PLABWIN10: Displaying selecting c$ (\\plabwin11) in the File Explorer window.
Step 5
Close the File Explorer window.
You will now delete the drive mapping. To do this, type the following command:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 42/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.29 Screenshot of PLABWIN10: Displaying the command to delete the drive mapping typed in.
The net user command has various parameters that can be used. Each one of
them performs a specific task. Using this command, you can manage local and
domain-based user accounts.
In this task, you will learn to use the net user command.
Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
https://www.practice-labs.com/app/platform/print.aspx 43/106
12/10/24, 12:53 PM Practice Labs | Print
To view the list of users on the local system, type the following command:
net user
Press Enter.
Figure 2.30 Screenshot of PLABWIN10: Displaying the command to view the list of users on the local
system entered and executed.
Step 2
Type the following command and press Enter:
net user /?
https://www.practice-labs.com/app/platform/print.aspx 44/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.31 Screenshot of PLABWIN10: Displaying the command to view the syntax of the net user
command entered and executed.
Note: The above net user command is used to view the syntax and the list
of parameters that can be used with the command.
Step 3
To view the information about a specific user account on the local system, type
the following command:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 45/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.32 Screenshot of PLABWIN10: Displaying the command to view the information about a specific
user account on the local system entered and executed.
Step 4
To create a new account with the name Louis, type the following command:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 46/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.33 Screenshot of PLABWIN10: Displaying the command to create a new account name entered
and executed.
Note: Notice that you are defining the new user account name as Louis. The
Password is Passw0rd. The /add parameter adds the user account, and the
user is configured to log in all days of the week.
Step 5
To view the list of users on the local system, type the following command:
net user
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 47/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.34 Screenshot of PLABWIN10: Displaying entering and executing the command to view the list of
users on the local system.
Note: Notice the new user account Louis has been added successfully.
Similar to creating a local account, you can also create a domain account by
adding the /<domain name> parameter.
Step 6
To delete the user Louis, type the following command:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 48/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.35 Screenshot of PLABWIN10: Displaying entering and executing the command to delete the user
named Louis.
Step 7
To verify that the user account Louis is deleted, type the following command:
net user
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 49/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.36 Screenshot of PLABWIN10: Displaying entering and executing the command to verify the
deletion of the user named Louis.
Note: Notice that the user account, Louis, is now deleted. It does not
appear in the list.
Step 1
https://www.practice-labs.com/app/platform/print.aspx 50/106
12/10/24, 12:53 PM Practice Labs | Print
tracert 192.168.0.1
Press Enter.
Figure 2.37 Screenshot of PLABWIN10: Displaying entering and executing the tracert command in the
Administrator: Command Prompt window.
Step 2
Type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 51/106
12/10/24, 12:53 PM Practice Labs | Print
tracert -d 192.168.0.1
Figure 2.38 Screenshot of PLABWIN10: Displaying the command to trace the path to a device without
performing name resolution entered and executed.
Note: The tracert command used with the d parameter will trace the path to
a device without performing name resolution. Notice that the response is
much quicker.
Step 3
You can perform path tracing to a domain name or a specific server on the
Internet. Type the following command:
tracert -d 8.8.8.8
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 52/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.39 Screenshot of PLABWIN10: Displaying entering and executing the required tracert command.
Step 4
You will now trace the path to the http://intranet Website. Type the following
command and press Enter:
tracert intranet
https://www.practice-labs.com/app/platform/print.aspx 53/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.40 Screenshot of PLABWIN10: Displaying the output after executing the command to trace the
path to the http://intranet Website.
Note: Notice that the first hop did not provide the information in a timely
manner. Then, the second hop was Intranet.
Step 5
Next, trace the path to the http://intranet website but with a defined timeout.
Type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 54/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 2.41 Screenshot of PLABWIN10: Displaying the command to trace the path to the http://intranet
Website with a defined timeout entered and executed.
Note: Notice that the first hop did respond within the defined timeout. If
you still get the timeout error, this is an expected result as your Tracert is
hitting our firewall, which is causing the first timeout.
In this task, you will learn how to use the pathping command.
Step 1
Ensure you are connected to PLABWIN10.
https://www.practice-labs.com/app/platform/print.aspx 55/106
12/10/24, 12:53 PM Practice Labs | Print
pathping 8.8.8.8
Figure 2.42 Screenshot of PLABWIN10: Displaying entering and executing the pathping command in the
Administrator: Command Prompt window.
Note: Here, Google's famous DNS server is used as the target for the
pathping command. This may take a couple of minutes to complete. The
triple * indicates that the ICMP is blocked on the server where PLABWIN10
is on.
Note: You can clear the Command Prompt window by entering the cls
command.
https://www.practice-labs.com/app/platform/print.aspx 56/106
12/10/24, 12:53 PM Practice Labs | Print
Leave all devices in their current state and proceed to the next exercise.
https://www.practice-labs.com/app/platform/print.aspx 57/106
12/10/24, 12:53 PM Practice Labs | Print
Learning Outcomes
After completing this exercise, you should be able to:
Your Devices
You will be using the following devices in this lab. Please power these on now.
The command has various parameters that can be used along with it, which can
perform various tasks.
Step 1
https://www.practice-labs.com/app/platform/print.aspx 58/106
12/10/24, 12:53 PM Practice Labs | Print
You can run the chkdsk command in read-only mode. To do this, type the
following command and press Enter:
chkdsk
Figure 3.1 Screenshot of PLABWIN10: Displaying the output of the chkdsk command in the Administrator:
Command Prompt window.
Note: Please note the Total Duration can vary from what’s shown in the
screenshot.
Step 2
Type the following command and press Enter:
https://www.practice-labs.com/app/platform/print.aspx 59/106
12/10/24, 12:53 PM Practice Labs | Print
chkdsk /C
Figure 3.2 Screenshot of PLABWIN10: Displaying entering and executing the chkdsk command with the /C
parameter.
Note: The chkdsk command with the /C parameter will skip checking cycles
in the folder structure. Please note the Total Duration can vary from what’s
shown in the screenshot.
Step 3
Next, type the following command and press Enter:
chkdsk c: /f /r
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 60/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.3 Screenshot of PLABWIN10: Displaying entering and executing the chkdsk command with the /f
and /r parameters.
Note: The /f parameter is used to fix hard drive errors. Along with this, you
can also use the /r parameter to locate bad sectors.
Step 4
When prompted for confirmation, type the following:
Press Enter.
Notice that the C drive will be checked on the next system restart.
Note: If time permits, you can restart the system right now and see the
check being performed.
https://www.practice-labs.com/app/platform/print.aspx 61/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.4 Screenshot of PLABWIN10: Displaying confirming the execution of the chkdsk command with
the /f parameter.
Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
To format the F drive, type the following command and press Enter:
format f: /q
https://www.practice-labs.com/app/platform/print.aspx 62/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.5 Screenshot of PLABWIN10: Displaying performing a quick format of the F drive in the
Administrator: Command Prompt window.
Note: Notice that you are prompted for the current volume label.
Step 2
Type the following volume label and press Enter:
PLABWIN10HDD2
https://www.practice-labs.com/app/platform/print.aspx 63/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.6 Screenshot of PLABWIN10: Displaying entering the existing volume label.
Step 3
Type the following to proceed with formatting the F drive:
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 64/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.7 Screenshot of PLABWIN10: Displaying confirming the formatting of the F drive.
Note: Notice that you are now prompted with the volume label.
Step 4
Type the following volume label and press Enter:
Data
https://www.practice-labs.com/app/platform/print.aspx 65/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.8 Screenshot of PLABWIN10: Displaying entering a new volume label and completing the
formatting of the drive.
Step 5
Minimize the Administrator: Command Prompt window.
In the File Explorer window, notice that the F drive is now labeled as Data on
the left pane.
https://www.practice-labs.com/app/platform/print.aspx 66/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.9 Screenshot of PLABWIN10: Displaying verifying the new volume label for F drive in File
Explorer.
Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
You will first create an empty text file using a command. Remember that it is
easy to create a text file using Notepad but a bit tricky when using the
command prompt.
Figure 3.10 Screenshot of PLABWIN10: Displaying creating an empty text file in the Administrator:
Command Prompt window.
Step 2
To verify if the file has been created, type the following command:
dir
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 68/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.11 Screenshot of PLABWIN10: Displaying listing the files in the current directory.
Step 3
You will now copy the file named ABCD.txt from the current directory
to c:\Users.
https://www.practice-labs.com/app/platform/print.aspx 69/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.12 Screenshot of PLABWIN10: Displaying entering and executing the command to copy the
ABCD.txt file to c:\Users.
Step 4
Whenever you attempt to copy a file to a destination and the same file exists,
you will be prompted with a warning. If the file exists in the destination
directory, you can still overwrite it without getting the warning.
https://www.practice-labs.com/app/platform/print.aspx 70/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.13 Screenshot of PLABWIN10: Displaying entering and executing the copy command with the /Y
parameter.
Note: The /Y parameter in the copy command suppresses the prompt for
confirmation to overwrite a file.
Step 1
Ensure you are connected to PLABWIN10.
https://www.practice-labs.com/app/platform/print.aspx 71/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.14 Screenshot of PLABWIN10: Copying all text files in the current directory to the Downloads
directory using the xcopy command.
Note: The xcopy command will copy all text files in the current directory to
the Downloads directory.
Step 2
Open File Explorer from the Windows Taskbar.
Select and right-click the Local Disk (C:) drive on the left pane.
PLAB
Figure 3.15 Screenshot of PLABWIN10: Displaying creating a new folder in File Explorer.
Step 3
Navigate inside the PLAB directory and create two directories and one text file.
Right-click anywhere on the details pane and select New > Folder.
Test1
Test2
https://www.practice-labs.com/app/platform/print.aspx 73/106
12/10/24, 12:53 PM Practice Labs | Print
PLAB1
Figure 3.16 Screenshot of PLABWIN10: Displaying creating a directory, sub-directories, and a text file in
File Explorer.
Step 4
Restore the Administrator: Command Prompt window from the Taskbar.
You will now copy the PLAB directory, including empty sub-directories and text
file, to the Downloads directory.
https://www.practice-labs.com/app/platform/print.aspx 74/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.17 Screenshot of PLABWIN10: Displaying copying the PLAB directory, including empty sub-
directories and text file, to the Downloads directory.
Note: Notice that the text file is now copied to the Downloads folder.
Step 5
To verify if the sub-directories and text file have been copied to
the Downloads directory, type the following command:
dir Downloads
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 75/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.18 Screenshot of PLABWIN10: Displaying verifying if the sub-directories and text file have been
copied to the Downloads directory.
Note: Notice that the sub-directories and text file are now copied to
the Downloads folder.
Robocopy will keep the original files and create a replica at the specified
location.
Step 1
https://www.practice-labs.com/app/platform/print.aspx 76/106
12/10/24, 12:53 PM Practice Labs | Print
To copy the Downloads directory files and sub-directories to c:\Users, type the
following command:
Press Enter.
Figure 3.19 Screenshot of PLABWIN10: Displaying copying the Downloads directory files and sub-
directories to c:\Users using the robocopy command in Administrator: Command Prompt window.
https://www.practice-labs.com/app/platform/print.aspx 77/106
12/10/24, 12:53 PM Practice Labs | Print
Step 1
Ensure you are connected to PLABWIN10.
sfc /scannow
This command may take longer than 10-20 minutes to complete. If you
would like to skip this step, please press Ctrl + c and move to the next step.
Figure 3.20 Screenshot of PLABWIN10: Displaying entering and executing the sfc command in the
Administrator: Command Prompt window.
Note: The /scannow parameter of the sfc command checks the protected
system files and repairs them if required. Notice that there were integrity
https://www.practice-labs.com/app/platform/print.aspx 78/106
12/10/24, 12:53 PM Practice Labs | Print
Step 2
You can use the sfc command to repair a specific file. Type the following
command and press Enter.:
sfc /scanfile=c:\windows\system32\ieframe.dll
Figure 3.21 Screenshot of PLABWIN10: Displaying repairing a file with the sfc command.
Step 3
Type the following command:
https://www.practice-labs.com/app/platform/print.aspx 79/106
12/10/24, 12:53 PM Practice Labs | Print
sfc /verifyonly
Press Enter.
This process runs for quite a long time. It may take more than an hour to
complete. For this task, you can break the command by pressing Ctrl+C.
Figure 3.22 Screenshot of PLABWIN10: Displaying verifying the protected files using the /verifyonly
parameter with the sfc command.
Note: You can use the /verifyonly parameter with the sfc command to
verify the protected files.
https://www.practice-labs.com/app/platform/print.aspx 80/106
12/10/24, 12:53 PM Practice Labs | Print
In short, the diskpart command allows you to create, delete, and resize the
partitions of your hard disk drive(s), as well as your external storage device's
drive(s).
Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
The set of commands mentioned below will get you to a specific disk of the
machine's hard drive. Once you reach there, a number of different activities,
such as creating a primary partition, can be performed.
diskpart
https://www.practice-labs.com/app/platform/print.aspx 81/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.23 Screenshot of PLABWIN10: Displaying entering and executing the command to start the
diskpart shell.
Step 2
Type the following command and press Enter:
list disk
https://www.practice-labs.com/app/platform/print.aspx 82/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.24 Screenshot of PLABWIN10: Displaying entering and executing the command to list the
available disks in the system.
Note: The list disk command will list the available disks in the system.
Step 3
To select a disk, type the following command:
select disk 1
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 83/106
12/10/24, 12:53 PM Practice Labs | Print
Step 4
To list the available disks in the system, type the following command and
press Enter:
list disk
https://www.practice-labs.com/app/platform/print.aspx 84/106
12/10/24, 12:53 PM Practice Labs | Print
Note: Notice that the selected disk has an * (asterisk) before it.
Step 5
To list the partitions on the selected disk, type the following command and
press Enter:
list partition
https://www.practice-labs.com/app/platform/print.aspx 85/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.27 Screenshot of PLABWIN10: Displaying entering and executing the command to list the
partitions on the selected disks.
Step 6
To select a partition, type the following command and press Enter:
select partition 2
https://www.practice-labs.com/app/platform/print.aspx 86/106
12/10/24, 12:53 PM Practice Labs | Print
Step 7
To make the partition active, type the following command:
active
Press Enter.
https://www.practice-labs.com/app/platform/print.aspx 87/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.29 Screenshot of PLABWIN10: Displaying entering and executing the command to make a
partition active.
Note: Notice the message that the partition cannot be marked as ACTIVE
because it is not a fixed MBR disk.
Step 8
You will need to quick format the partition with the NTFS file system and then
assign drive letter F to it.
https://www.practice-labs.com/app/platform/print.aspx 88/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.30 Screenshot of PLABWIN10: Displaying entering and executing the command to perform a
quick format of the selected partition.
Step 9
To exit from diskpart, type the following command and press Enter:
exit
Note: You can get the list of commands by invoking diskpart and then
typing help.
https://www.practice-labs.com/app/platform/print.aspx 89/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 3.31 Screenshot of PLABWIN10: Displaying entering and executing the command to exit from the
diskpart shell.
Note: You can clear the Command Prompt window by entering the cls
command.
Leave all devices in their current state and proceed to the next exercise.
https://www.practice-labs.com/app/platform/print.aspx 90/106
12/10/24, 12:53 PM Practice Labs | Print
Learning Outcomes
After completing this exercise, you should be able to use:
Your Devices
You will be using the following devices in this lab. Please power these on now.
A user can run the gpupdate (group policy update) command on the local
system to apply the policy. The recipient system must be part of the domain in
which the policy is created.
Step 1
Ensure you are connected to PLABWIN10, where the Administrator: Command
Prompt window is open.
https://www.practice-labs.com/app/platform/print.aspx 91/106
12/10/24, 12:53 PM Practice Labs | Print
To run the gpupdate command without any parameter, type the following
command:
gpupdate
Press Enter.
Figure 4.1 Screenshot of PLABWIN10: Displaying entering and executing the gpupdate command without
any parameter.
Step 2
To apply all the policies, not only the ones that have changed, type the following
command and press Enter:
gpupdate /force
https://www.practice-labs.com/app/platform/print.aspx 92/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.2 Screenshot of PLABWIN10: Displaying entering and executing the command to apply all
policies.
Step 3
When you run the gpupdate command, user and computer policies are applied
by default. You can also choose to apply either user or computer.
gpupdate /Target:User
https://www.practice-labs.com/app/platform/print.aspx 93/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.3 Screenshot of PLABWIN10: Displaying the command to update a specific set of policies entered
and executed.
Note: If you provide a blank space after the colon, the command will not
run. Instead, it will show the help for gpupdate.
Step 4
The default number of seconds to wait for policy processing is 600 seconds. You
can remove the wait time.
gpupdate /Wait:0
https://www.practice-labs.com/app/platform/print.aspx 94/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.4 Screenshot of PLABWIN10: Displaying the command to remove the wait time for the policy
update entered and executed.
These policies can overlap in nature. The gpresult command generates the
resultant set of the applicable policies after considering the overlapping.
Step 1
In PLABWIN10, the Administrator: Command Prompt window is open.
To display the RSoP summary data, type the following command and
press Enter:
https://www.practice-labs.com/app/platform/print.aspx 95/106
12/10/24, 12:53 PM Practice Labs | Print
gpresult /r
Figure 4.5 Screenshot of PLABWIN10: Displaying entering and executing the gpresult command with the
/r parameter.
Note: The output of this command spans multiple pages. You will need to
scroll and read the information. The screenshot below displays the
information from the start of the output of the command.
Step 2
To display all the information about the Group Policy, type the following
command and press Enter:
gpresult /z
https://www.practice-labs.com/app/platform/print.aspx 96/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.6 Screenshot of PLABWIN10: Displaying the command to view the information about Group
Policy entered and executed.
Note: The output of this command spans multiple pages. You will need to
scroll and read the information. The screenshot below displays the
information from the start of the output of the command.
In this task, you will learn to reference a command's options list using
Command-Line.
Step 1
https://www.practice-labs.com/app/platform/print.aspx 97/106
12/10/24, 12:53 PM Practice Labs | Print
ping /?
Figure 4.7 Screenshot of PLABWIN10: Displaying entering and executing the ping command with the
required parameter.
Note: The multiple options that can be used with the ping command are
listed. The ping command was used in this example, but this same syntax
can be used with other commands, such as "ipconfig /?".
https://www.practice-labs.com/app/platform/print.aspx 98/106
12/10/24, 12:53 PM Practice Labs | Print
The winver command lets you know the exact version of Windows being used on
the machine. The Windows version number can change over time as Windows
updates regularly, and this command allows you to see the current Windows
version being used.
Step 1
Ensure you are connected to PLABWIN10, where the Administrator: Command
Prompt window is open.
winver
Note: The About Windows window displays information about the current
https://www.practice-labs.com/app/platform/print.aspx 99/106
12/10/24, 12:53 PM Practice Labs | Print
Windows version being used, in this case: Windows 10 Pro - Version 21H1.
The limitation of the 'shutdown' command is that it can be used on one machine
at a time. If you want to use the command on multiple machines, then you have
to type the command the same number of times as your machine count.
Step 1
Ensure you are connected to PLABWIN10.
shutdown /r
https://www.practice-labs.com/app/platform/print.aspx 100/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.9 Screenshot of PLABWIN10: Displaying the command to restart the system typed in.
Note: The shutdown command with the /r parameter will restart the
system.
Step 2
You are prompted with a message for signing out.
Click Close.
https://www.practice-labs.com/app/platform/print.aspx 101/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.10 Screenshot of PLABWIN10: Displaying clicking Close on the You're about to be signed out
message box.
Step 3
The PLABWIN10 device now reboots. You need to go to the Practice Labs
environment and invoke PLABWIN10 once again.
shutdown /r /t 0
https://www.practice-labs.com/app/platform/print.aspx 102/106
12/10/24, 12:53 PM Practice Labs | Print
Figure 4.11 Screenshot of PLABWIN10: Displaying entering and executing the shutdown command with
the required parameters.
Note: Notice this time you did not get a message dialog box. This is because
you had defined the restart with the value of 0, which means immediately
without a wait.
Keep all devices that you have powered on in their current state and
proceed to the review section.
https://www.practice-labs.com/app/platform/print.aspx 103/106
12/10/24, 12:53 PM Practice Labs | Print
Review
Well done, you have completed the Managing a Windows Device using the
Command Line Interface Practice Lab.
Summary
You completed the following exercises:
Navigation Commands
The Ipconfig Command
The Ping Command
The Hostname Command
The Netstat Command
The Nslookup Command
The Net Use Command
The Net User Command
The Tracert Command
The Pathping Command
The Chkdsk Command
The Format Command
The Copy Command
The Xcopy Command
The Robocopy Command
The Sfc Command
The Diskpart Command
The Gpupdate Command
The Gpresult Command
The Shutdown Command
[Command Name] /?
The Winver Command
Feedback
https://www.practice-labs.com/app/platform/print.aspx 104/106
12/10/24, 12:53 PM Practice Labs | Print
Shutdown all virtual machines used in this lab. Alternatively, you can log out
of the lab platform.
https://www.practice-labs.com/app/platform/print.aspx 105/106
12/10/24, 12:53 PM Practice Labs | Print
https://www.practice-labs.com/app/platform/print.aspx 106/106