BASIC INFORMATION ABOUT WINDOWS COMMAND PROMPT

Table of Contents

INTRODUCTION

Command Prompt is the command line application in the windows which is very helpful many times.

Many tools are used through the command prompt. Although it looks boring, but it is quite powerful.

In this article we’d learn the very basic commands which are useful to use the command prompt.



OPEN COMMAND PROMPT OR POWER SHELL IN WINDOWS 10 OR WINDOWS 11

It is very easy to open the command prompt or power shell in windows 10 or windows 11.

Follow the steps to open command prompt or power shell in windows 10 or windows 11.

  • Open the start menu by clicking on the WINDOWS BUTTON in the lower left corner.
  • Type in the search box “CMD” or “cmd” and ” POWER SHELL” or “power shell” in the search box.
  • The options will be enlisted.
  • Click the option and the application will open.

ENTER THE PROGRAM NAME “COMMAND PROMPT” TO FIND IT

For the POWER SHELL we’ll use the name POWER SHELL and click on the enlisted option. It’ll open POWER SHELL.



ENTER THE PROGRAM NAME “POWERSHELL” AND CHOOSE THE PROGRAM



UNDERSTAND STRUCTURE OF COMMAND PROMPT IN WINDOWS 10 OR WINDOWS 11

When command prompt will open, the following screen will appear.

CURRENT LOCATION

Different areas in command prompt

  • The path shown in the left side shows the current location of the control. [ CONTROL IS SIMPLY THE ACTIVE AREA]
  • For example, the picture shown above shows the control in the folder GYANKOSH.NET which means whatever commands we apply will work upon the data present in the folder.

MOVE INSIDE A DIRECTORY IN COMMAND PROMPT OR POWER SHELL

As we saw in the previous section that the address shown by the command prompt is the current location of the control where the commands will act.

In this section we’ll learn the way to move inside any directory.

THE COMMAND TO MOVE INSIDE ANY DIRECTORY  / FOLDER IS CD (SPACE) FOLDER/DIRECTORY NAME.

FOLLOW THE STEPS TO MOVE INSIDE ANY FOLDER/DIRECTORY IN COMMAND PROMPT / POWER SHELL

  • The current control is in the user directory GYANKOSH.NET.
  • Enter the command cd desktop
  • It’ll take the control to the desktop folder.

ENTER ANY FOLDER USING CD COMMAND



EXIT ANY FOLDER/DIRECTORY IN COMMAND PROMPT OR POWER SHELL

In the previous section we saw the steps to enter into any folder or directory. But we also need to exit any directory or folder so that we can change the path directly.

THE COMMAND TO EXIT ANY FOLDER OR DIRECTORY TO GO TO ITS PARENT DIRECTORY IS CD.. [ CD DOUBLE DOT ]

To check it yourself, let us follow the given steps.

Suppose we want to exit the current folder GYANKOSH.NET and reach the parent folder which is …………. for this example.

FOLLOW THE STEPS TO EXIT THE CURRENT FOLDER/DIRECTORY TO REACH PARENT DIRECTORY

  • Enter the command as cd.. .
  • Press Enter.
  • You’ll exit the current location and reach the parent level i.e. the folder which is containing the current folder from where we used the cd.. command.
EXIT THE CURRENT FOLDER USING CD..



EXIT FROM THE CURRENT FOLDER DIRECTLY TO PARENTAL DRIVE IN COMMAND PROMPT OR POWER SHELL

Suppose we are deep inside any directory where we were trying to do something but we couldn’t find what we were looking for.

Now , if we want to get to the other place which is far lower in the folder tree. We can do that in a few ways.

One is the standard way, where we’ll be using the command cd.. which we just learnt on every level and reach there.

Or, we do have one another way by which we can directly reach the parental drive level.

THE COMMAND TO EXIT ALL THE FOLDERS OR DIRECTORIES AND REACH THE PARENTAL DRIVE LEVEL IS CD\.

Let us learn this with the use of an example.

FOLLOW THE STEPS TO EXIT ALL THE FOLDERS AND REACH THE BASIC LEVEL OR PARENTAL DRIVE LEVEL IN COMMAND PROMPT.

  • Simply put the command cd\.
  • Press enter.
  • The control will move to root level. [ Root level is the parental drive level such as C:\>


USE CD\ TO EXIT ALL THE FOLDERS AND REACH PARENT DRIVE

MOVE FROM ONE DRIVE TO ANOTHER IN COMMAND PROMPT OR POWER SHELL

This requirement might arise sometimes when we want to move from one drive to another directly.

THE WAY TO MOVE FROM ONE DRIVE TO ANOTHER IS BY SIMPLY TYPING THE DRIVE LETTER FOLLOWED BY A COLON. I.E. D: , FOR MOVING TO D DRIVE DIRECTLY AND SO ON.

CHANGE ACTIVE DRIVE IN COMMAND PROMPT



CREATE ANY DIRECTORY USING COMMAND PROMPT OR POWER SHELL IN WINDOWS

The process to create a directory using the command prompt is very simple.

DIRECTORY IS SIMPLY A FOLDER IN THE COMMON LANGUAGE.
COMMAND TO CREATE A DIRECTORY IN WINDOWS 10 OR WINDOWS 11 IS MKDIR



FOLLOW THE STEPS TO CREATE A FOLDER ON THE DESKTOP

  • Open the Command prompt by the process discussed in the previous section.
  • The current location of the command is inside the user GYANKOSH.NET.
  • We want to create the directory in the desktop which means we want the control to reach the desktop first.
  • Take the control inside desktop directory/folder as discussed in the previous section.
  • Now, we can create the directory on desktop.
  • Enter the command mkdir folder/directory name.
  • For our example, we’ll create a directory named Gyankosh. Enter the command as mkdir Gyankosh.
CREATE DIRECTORY USING MKDIR

  • We can reach our desktop and check that a folder/directory has been created with the name Gyankosh.
CREATED FOLDER