Home > Articles > CompTIA > A+

Using the Command Prompt

The Command Prompt in Windows is a useful command-line interpreter which not only allows for specific usage in the Windows environment but also can be configured to your needs. In this article, David Prowse explains Microsoft’s command-line interpreter and offers tips on configuration and use.
Like this article? We recommend

The Command Prompt is Microsoft’s version of a command-line interpreter or CLI. Some people refer to it as DOS because of its similarity to the DOS command-line. However, the Command Prompt is a Windows entity. The beauty of the Command Prompt is that you can navigate to and configure just about anything in text. Just about anything than can be done in Windows can be done in the Command Prompt.

This article shows how to open the Command Prompt, configure it to your liking, and then explains some of the basics of how to use it.

How to open the Command Prompt

The Command Prompt can be opened in a variety of ways, which will depend on the version of Windows you are using. For example, in Windows 7, you would click Start > All Programs > Accessories > Command Prompt. Another way to access it would be to click Start > Run, then type cmd.exe. Depending on your version of Windows, the Run prompt might not show up in your Start menu, but you can easily access it by pressing the Windows + R keys together. If you need to run the Command Prompt as an Administrator, click Start > All Programs > Accessories, and right-click Command Prompt and select Run as Administrator.

Of course these are only a few of the ways you could open the program; do whatever is fastest for you!

Once you have the Command Prompt open, it will look something similar to Figure 1:

Figure 1 Example of Windows 7 Command Prompt

In Windows 7, by default, this places you in the C:\Users\%username% folder. %username% is whatever user you are logged in as. If you ran the Command Prompt as an administrator, the path you are placed in would be C:\Windows\system32. You can also tell the difference by looking at the title bar of the Command Prompt. If you are running the Command Prompt as an administrator, it will say “Administrator: Command Prompt” in the title bar.

Configuring the Command Prompt to your liking

The initial look of the Command Prompt may be a bit hard on the eyes. With its standard black background and small text, you might wish to modify it. Let’s make it a white background with black text, and increase the size of the text a bit.

In this step-by-step, we will use the Windows 7 Command Prompt.

  1. Open the Command Prompt.
  2. Right-click the title bar and select Properties. This displays the Command Prompt Properties dialog box.
  3. Click the Font tab, and select 12X16 in the Size area. This should noticeably change the size of the text which you can see in the “Selected Font: Terminal” area.
  4. Click the Colors tab, and select the white color box to change the screen background.
  5. Next, click Screen Text, and select the black color box to change the screen text. This should give you a white background with black lettering, as shown in the “Selected Screen Colors” area. An example of this is shown in Figure 2. Of course, feel free to select whatever colors you like[md]even the old school Commodore 64 blue on blue!

Figure 2 Example of a Modified Windows 7 Command Prompt

You can also change the size of the window in the layout tab, as well as how much history will be remembered by the Command Prompt. Use these options to configure a Command Prompt that displays what you want in a pleasing fashion.

Using the Command Prompt

Now let’s talk some of the basics when it comes to using the Command Prompt. I’ll delve into three areas: navigation of the operating system, how to ping another computer on the network, and the creation of batch files.

Navigation

Navigating the operating system is done with the CD command. You can go anywhere in the directory tree with this command. (By the way, “directories” and “folders” are synonymous.)

For example, in Figure 2 I am currently located in the C:\Users\Lamprocles path. (Lamprocles is one of my silly usernames.) If you wanted to go to the root of C in one fell swoop, you could easily do this by typing CD \, as shown in Figure 3.

Figure 3 Use of the CD \ Command

To return to the folder we were at before, we could type CD \users\lamprocles. It works in this manner regardless of what folder you want to access. Any folder in any path can be accessed in this way; just be sure to remember the root \ in the beginning of each path. To see commands that you typed previously, press the Up arrow on the keyboard. You will be able to scroll back and forth through the commands you used, and it makes for a nice timesaver.

Pinging

To find out if another computer on the network is “alive” or available to you for communication, you can use the ping command. Ping reaches out to the remote computer and returns results based on whether it finds the computer. For example, if your computer had the IP address of 192.168.1.1 and a second computer on the network had the IP address 192.168.1.2, you could verify the existence of that second computer on the network by typing ping 192.168.1.2. After pressing Enter, you should receive replies. If you do not, the computer is not available on the network, or your computer is not accessing the network properly. You could also use this command to ping your router, other computers on the network, even websites. Try pinging my personal website with the following command: ping davidlprowse.com.

Batch Files

Batch files are files that contain one or more commands. These files can be executed to produce one or more results without having to open the Command Prompt. For example, let’s say you wanted to ping another computer every day but didn’t want to go through the hassle of opening the Command Prompt, typing the command, and waiting for the answers. You could create a batch file that would automate the process. To do so you would open a new file in Notepad (this can be opened by accessing the Run prompt and typing notepad), and create the batch file by typing ping 192.168.1.2 for example. Then you would select File > Save As. Next, Click the Save as type drop-down menu and select All Files. Then name the file (for example, ping.bat). Note the .bat extension. Save the file to your desktop or wherever you like.

Afterwards, to run the file, you double-click it. In Windows 7 and Vista you would need to right-click it and select Run as administrator in order for it to work properly. This automatically opens the Command Prompt (our modified version with new colors and font size), starts the ping, and awaits replies from the host, 4 in total. Plus, you can do this with just about any command, or groups of commands. Also, the batch file can output the results to text files or to printers. Automation saves you time, and batch files can be very instrumental when it comes to automation. In 32-bit Windows versions, you can even create the batch files from within the Command Prompt by using the edit command. However, this is not available by default in 64-bit versions, and would have to be added to an existing Windows 64-bit installation.

Pearson IT Certification Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Pearson IT Certification and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Pearson IT Certification products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.pearsonitcertification.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020