💻

Windows Command Line Tools

Feb 17, 2025

Windows Command Prompt - Key Concepts and Commands

Introduction to Command Prompt

  • CLI (Command Line Interface): Access to the OS via text-based commands.
  • Running Commands:
    • Most commands can be run by users with standard privileges.
    • For administrative rights, use an elevated prompt.
    • Launch CMD as administrator: "CMD" + Ctrl+Shift+Enter.

Starting the Command Prompt

  • Search for CMD and choose options like Open, Run as Administrator.
  • Command prompt starts with no information; requires user input.
  • Help Command: Provides assistance for other commands (e.g., DIR, Check Disk, Copy).

Basic Navigation Commands

  • DIR: Lists files and directories in the current folder.
  • CD (Change Directory): Move to a different folder.
  • Dot Notation:
    • .. moves to the parent directory.
  • Creating/Removing Folders:
    • MKDIR / MD for making directories.
    • RMDIR / RD for removing directories.

Viewing and Manipulating Files

  • File Explorer vs. Command Line:
    • Both show files and directories but command line is useful without GUI.
  • Example Commands:
    • DIR to list files.
    • MD/RD to create/remove directories.

Drive Letters

  • Designation: Letters assigned to drives (e.g., C: for local drive).
  • Multiple Drives: System can have multiple drive letters (e.g., C, D, E).

Identifying Systems

  • Hostname Command: Shows the name of the computer to ensure actions are on the correct system.

File Systems and Formatting

  • FORMAT Command: Installs a file system on a partition; can erase existing data.
  • Example: format k: for creating file system on drive K.

Copying Files

  • COPY Command: Copies files with options like /v for verification, /y to overwrite without prompts.
  • XCOPY Command: Use /s to copy directories and subdirectories.

Advanced File Copying

  • ROBOCOPY Command: Enhanced version of XCOPY with more options (e.g., bandwidth control).

Shutting Down and Restarting

  • SHUTDOWN Command:
    • /s to shut down.
    • /r to restart.
    • /a to abort a shutdown.

Managing Partitions

  • DISKPART Command: Creates, modifies, or deletes partitions.

Checking Windows Version

  • WINVER Command: Displays version and build number of Windows.

Group Policy Commands

  • GPUPDATE Command: Forces a Group Policy update.
  • GPRESULT Command: Shows current Group Policy settings.
  • Practical Use: Use GPUPDATE to apply new policies without logging out.