Revision #29

You are currently reviewing an older revision of this page.
Go to current version

 This topic is work in progress.
Please abstain from editing it right now. You're welcome to contribute here in a couple of hours or days, though!
Please remove this sign if there are no changes made in last 72 hours.

When Microsoft originally introduced Windows, the assumption was that you no longer needed the command line and many people left it behind completely. After all, why bother with the command line when you can access everything you need from the graphical environment? The problem is that the Windows Graphical User Interface (GUI) doesn’t actually provide access to everything on your system. In addition, all of that mousing around wastes considerable time and effort. Every time that you want to perform a task, you start it from scratch, which means that you have plenty of opportunities for making mistakes. This Wiki article reveals the command line to you. Using the information in this article, you not only discover the vast array of commands that are at your disposal but you also see how to automate those commands so that you can save significant time and effort while performing administrative tasks.



Command Prompt Basics


  • Launching and Using the Command Prompt

  • Launching the command prompt with elevated privileges
  • Using the built-in Doskey.exe program
  • Creating mini macros in doskey
  • Copying from and pasting into the command prompt window
  • Changing the options and display of the command prompt
  • Basic Rules When Using the Command Prompt

  • Using uppercase or lowercase? (en-US)
  • Using quotes to enclose spaces (en-US)
  • Understanding variables (en-US)
  • Understanding switches (en-US)
  • Understanding wildcards (en-US)
  • Getting help (en-US)
  • Using Basic Commands

  • Understanding folders and directories (en-US)
  • Understanding paths (en-US)
  • Viewing files and folders with "dir" Command (en-US)
  • Changing the path with "cd" Command (en-US)
  • Using drag and drop to the Command Prompt window
  • Deleting folders with rd
  • Creating folders with md
  • Controlling output with more
  • Redirecting output
  • Using "exit" Command
Return to Top


Working with Files, Folders, and Disks


  • Manipulating Files and Folders

  • Associating File Extensions with "assoc" and "ftype" Commands (en-US)
  • Viewing Attributes with "attrib" Command (en-US)
  • Compressing Files with "compact" Command (en-US)
  • Encrypting Files with "cipher" Command (en-US)
  • Copying Files with "copy", "xcopy", and "robocopy" Commands (en-US)
  • Deleting or Removing Files with "del" Command (en-US)
  • Expanding Cabinet Files with "expand" Command (en-US)
  • Taking Ownership of Files with "takeown" Command (en-US)
  • Removing the Windows.old Folder (en-US)
  • Mapping Drives with "net use" Command (en-US)
  • Manipulating Disks

  • Manipulating and Viewing Disks with "diskpart" Command (en-US)
  • Defragmenting Volumes with "defrag" Command (en-US)
  • Converting to NTFS with "convert" Command (en-US)
  • Managing the File System with "fsutil" Command (en-US)
Return to Top


Managing and Maintaining Windows


  • Using Windows 7 Maintenance Tools

  • Controlling Power Settings with "powercfg" Command (en-US)
  • Checking Memory with "mdsched" Command (en-US)
  • Manipulating Services with "sc" Command (en-US)
  • Collecting Events with "wecutil" Command (en-US)
  • Restarting Systems with "shutdown" Command (en-US)
  • Launching Control Panel Applets from the Command Line (en-US)
  • Retrieving Information About Windows 7

  • Viewing System Information with "systeminfo" Command (en-US)
  • Viewing User Information with "whoami" Command (en-US)
  • Launching System Configuration with "msconfig" Command (en-US)
  • Managing Security in Windows 7

  • Manipulating credentials with "cmdkey" Command (en-US)
  • Installing updates with "wusa" Command (en-US)
  • Installing applications with "msiexec" Command (en-US)
  • Auditing systems with "mbsacli" Command (en-US)
  • Configuring Windows 7 with netsh

  • understanding "netsh" Command (en-US)
  • Understanding contexts (en-US)
  • Configuring a proxy server (en-US)
  • Configuring the network interface with "netsh" Command (en-US)
Return to Top


Troubleshooting Windows


  • Configuring Windows Using Basic Troubleshooting Tools

  • Troubleshooting Network Issues

  • Using Recovery Tools

  • Manipulating the Boot Process with "bcdedit" Command (en-US)
  • Creating a System Repair Disc with "recdisc" Command (en-US)
  • Checking and Repairing Disks with "chkdsk" Command (en-US)
  • Repairing BitLocker Drives with "repair-bde" Command (en-US)
Return to Top


Remote Administration


  • Managing Windows 7 Remotely

  • Configuring Windows 7 for Remote Administration (en-US)
  • Connecting to Remote Systems with "mstsc" Command (en-US)
  • Configuring Windows Remote Management with "winrm" Command (en-US)
  • Executing Commands Remotely with "winrs" Command (en-US)
  • Windows Management Instrumentation Command Line

  • Understanding wmic
  • Configuring the Firewall to Allow wmic
  • Running wmic
  • Modifying the Format with the /format Switch
  • Retrieving Help from wmic
  • Understanding Aliases
  • Using Verbs
Return to Top


Creating and Managing Windows Images


  • Understanding Images

  • Understanding WIM files
  • Using Windows Deployment Services and images
  • Comparing boot and install images
  • Comparing thick and thin images
  • Preparing a System to Be Imaged with sysprep

  • Understanding sysprep (en-US)
  • Running the sysprep GUI (en-US)
  • Running sysprep from the command line (en-US)
  • Installing the Windows Automated Installation Kit

  • Downloading the WAIK (en-US)
  • Installing the WAIK (en-US)
  • Viewing the WAIK tools (en-US)
  • Using imagex

  • Creating WinPE on a bootable USB
  • Capturing images with imagex
  • Appending images with imagex
  • Deleting images with imagex
  • Deploying images with imagex
  • Using the Deployment Image Service and Management (DISM) Tool

  • Online servicing versus offline servicing (en-US)
  • Mounting images (en-US)
  • Getting information about mounted images (en-US)
  • Modifying images (en-US)
  • Saving images (en-US)
Return to Top


Working with WinPE and Windows Setup


  • WinPE Commands

  • Add drivers to WinPE with "drvload" Command (en-US)
  • Run commands within WinPE with "wpeutil" Command (en-US)
  • Installing Windows 7 with setup

  • Installing Windows 7 with "setup" (en-US)
  • Using the autounattend.xml file (en-US)
  • Using "slmgr" Command (en-US)
Return to Top


Using PowerShell


  • Understanding PowerShell Commands

  • Launching PowerShell
  • Understanding PowerShell verbs and nouns
  • Tabbing through PowerShell commands
  • Understanding the different types of PowerShell commands
  • Creating aliases
  • Discovering Windows PowerShell commands
  • Exploring get-member
  • Redirecting output with Windows PowerShell
  • Understanding PowerShell errors
  • Understanding PowerShell variables
  • Using comparison operators
  • Understanding pipelining
  • Using the Integrated Scripting Environment (ISE)

  • Launching the ISE
  • Exploring the ISE
  • Executing commands in the ISE
  • Creating and saving a script in the ISE
  • Creating and Running PowerShell Scripts

  • Setting the security context
  • Creating a PowerShell profile
  • Creating and modifying the Global PowerShell profile
  • Running PowerShell Scripts
  • Flushing the DNS cache
  • Creating a list of domain computers
  • Logging processes with a get-process script
  • Testing for the existence of a file
  • Creating output as HTML
  • Running a script against multiple computers
  • Creating a PowerShell message box
  • Scheduling PowerShell scripts
Return to Top


Group Policy and Command Line


  • Group Policy Command-Line Tools

  • Refreshing Group Policy Settings with "gpupdate" Command (en-US)