1. Using Uppercase or Lowercase
In almost all instances, you can enter command prompt
commands as uppercase, lowercase, or a combination of the two. In other
words, the following commands are all interpreted the same:
Mixed Case | Lowercase | Uppercase |
---|
RepAdmin /SyncAll | Repadmin /syncall | REPADMIN /SYNCALL |
ADPrep /ForestPrep | adprep /forestprep | ADPREP /FORESTPREP |
DCPromo | Dcpromo | DCPROMO |
Documentation and help files commonly show the first
letter as uppercase and when the command has two words in it, both words
are uppercase, such as RepAdmin.
This is sometimes called Pascal-casing (from the Pascal language) or
camel casing (because the uppercase letters resemble the humps of a
camel). It’s done for readability and doesn’t affect how the command is
interpreted at the command line.
There are some exceptions where case does matter, but
they are rare. For example, when adding roles to a Windows Server 2008
Server Core installation, the case of the role is important. The proper
case when adding the DHCP Server role with the ocsetup command is DHCPServerCore. The following table shows how to use the ocsetup command with the incorrect case and the proper case.
start ocsetup Command | Description |
---|
start ocsetup serverrole | The start ocsetup command is used to add roles to a Server Core installation; however, the role must be entered in a specific case. |
c:\>start ocsetup
dhcpservercore
| The start ocsetup command must be entered using the exact case. The example command will fail (as shown in Figure 1) because DHCPServerCore isn’t entered with the proper case. |
c:\>start ocsetup
DHCPServerCore
| This command will succeed because DHCPServerCore is entered with the proper case. |
2. Using Quotes
The command-line interpreter understands a space as the next part of the command. For example, consider how ping is used in the following table.
ping Command | Description |
---|
C:\>ping dc1 | The space after ping indicates that ping is the command, and what follows (dc1) is a parameter for the ping command. This sends four echo requests to dc1 and gets four echo replies back if the server is operational. |
Some parameters can have spaces. When a parameter has
a space, the parameter must be enclosed in quotes. For example, you can
use the netsh command to change the configuration of a network interface card (NIC). The default name of the first NIC is Local Area Connection but because Local Area Connection has spaces, it must be enclosed in quotes as “Local Area Connection” so that the netsh command can interpret it correctly.
Tip
The netsh command is the only way to configure the NIC for a Server Core installation.
netsh Command | Description |
---|
netsh interface ipv4 set address name
= Name of NIC static ip address subnet mask
| The netsh command changes the configuration of a NIC. It needs the name of the NIC, an IP address, and a subnet mask.
|
C:\>netsh interface ipv4 set address
name = "local area connection" static
192.168.1.15 255.255.255.0
| This command works, setting the IP address and subnet mask of the NIC.
The default name of the first NIC is Local Area Connection and because it includes a space, it must be enclosed in quotes. |
C:\>netsh interface ipv4 set address
name = local area connection static
192.168.1.15 255.255.255.0
Invalid source parameter (area).
| This command fails.
If local area connection is not enclosed in quotes, netsh interprets local as the name of the NIC but doesn’t understand area. |