Skip to content

Command Prompt Documentation Welcome to the comprehensive guide to using the Command Prompt! Whether you're a complete beginner or looking to master advanced commands, this documentation will walk you through everything you need to know about the Command Prompt in Windows.

License

Notifications You must be signed in to change notification settings

dev-aditya-lab/command-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hi πŸ‘‹! My name is Aditya Kumar Gupra and I'm a student, from Jharkhand, India

javascript logo react logo html5 logo css3 logo nodejs logo express logo mongodb logo php logo figma logo canva logo bootstrap logo tailwindcss logo git logo github logo mysql logo nextjs logo


Command Prompt Documentation

Welcome to the comprehensive guide to using the Command Prompt! Whether you're a complete beginner or looking to master advanced commands, this documentation will walk you through everything you need to know about the Command Prompt in Windows.

Table of Contents

  1. Introduction to Command Prompt
  2. Basic Commands
    1. Navigating the File System
    2. Managing Files and Folders
  3. Intermediate Commands
    1. System Information and Diagnostics
    2. Network Commands
  4. Advanced Commands
    1. Batch Files and Scripting
    2. Task Scheduling and Automation
  5. Tips and Tricks
  6. Resources

Introduction to Command Prompt

The Command Prompt, also known as CMD, is a command-line interpreter application available in most Windows operating systems. It's a powerful tool that allows users to execute commands to perform various tasks, ranging from basic file management to complex scripting.

Opening the Command Prompt

To open the Command Prompt:

  1. Press Win + R to open the Run dialog.
  2. Type cmd and press Enter.

Alternatively, you can search for "cmd" or "Command Prompt" in the Start menu.

Anatomy of the Command Prompt

When you open the Command Prompt, you'll see something like this:

C:\Users\YourUsername>
  • C: indicates the current drive.
  • \Users\YourUsername shows the current directory path.
  • > is the prompt symbol, indicating the Command Prompt is ready to accept commands.

Basic Commands

Let's start with some fundamental commands to get you comfortable with the Command Prompt.

Navigating the File System

  1. dir: Lists the files and directories in the current directory.

    dir
  2. cd (Change Directory): Changes the current directory.

    • To navigate to a different directory:
      cd path\to\directory
    • To go up one level in the directory structure:
      cd ..
  3. cls: Clears the Command Prompt screen.

    cls

Managing Files and Folders

  1. mkdir (Make Directory): Creates a new directory.

    mkdir NewFolder
  2. rmdir (Remove Directory): Deletes a directory.

    • To delete an empty directory:
      rmdir FolderName
    • To delete a directory and its contents:
      rmdir /s /q FolderName
  3. copy: Copies files from one location to another.

    copy SourceFile Destination
  4. move: Moves files from one location to another.

    move SourceFile Destination
  5. del: Deletes one or more files.

    del FileName

Intermediate Commands

System Information and Diagnostics

  1. systeminfo: Displays detailed configuration information about your computer.

    systeminfo
  2. tasklist: Lists all currently running tasks and their details.

    tasklist
  3. taskkill: Terminates a running process.

    taskkill /im ProcessName /f

Network Commands

  1. ipconfig: Displays the current network configuration.

    ipconfig
  2. ping: Tests connectivity to another networked device.

    ping www.example.com
  3. tracert: Traces the route taken to reach a networked device.

    tracert www.example.com
  4. netstat: Displays active network connections and statistics.

    netstat

Advanced Commands

Batch Files and Scripting

Batch files are scripts that contain a series of commands to be executed sequentially by the Command Prompt.

  1. Creating a Batch File:

    • Open Notepad.
    • Write your commands, one per line.
    • Save the file with a .bat extension (e.g., script.bat).
  2. Running a Batch File:

    • In the Command Prompt, navigate to the directory containing the batch file.
    • Type the name of the batch file and press Enter.
      script.bat

Task Scheduling and Automation

  1. schtasks: Schedules commands and programs to run periodically or at a specific time.

    • To create a new scheduled task:
      schtasks /create /sc daily /tn "MyTask" /tr "C:\Path\To\Script.bat" /st 12:00
    • To list all scheduled tasks:
      schtasks /query
  2. at: Schedules commands and programs to run on a computer at a specified time and date.

    at 14:00 /every:M,T,W,Th,F "C:\Path\To\Script.bat"

Tips and Tricks

  • Autocomplete Paths: Press Tab while typing a path to autocomplete folder and file names.
  • Command History: Use the up and down arrow keys to cycle through previously entered commands.
  • Redirection Operators: Use > to redirect output to a file and >> to append to a file.
    dir > filelist.txt

Resources


About

Command Prompt Documentation Welcome to the comprehensive guide to using the Command Prompt! Whether you're a complete beginner or looking to master advanced commands, this documentation will walk you through everything you need to know about the Command Prompt in Windows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published