CheatSheet - Windows

Synopsis: Quick Command Line Reference

Published July 15th, 2025
Last Modified: October 29, 2025

Intro: Evergrowing cheat sheet for Windows Commands






CMD

Domain and WorkGroup Management --------- sysdm.cpl
Quick Shutdown CMD --------------------------- shutdown /r

New Admin User

net user /add tempAdmin PASSWORD
net localgroup administrators tempAdmin /add

FSMO

CMD: netdom query fsmo
PS: Move-ADDirectoryServerOperationMasterRole "SERVERNAME" -OperationMasterRole 0,1,2,3,4

Host File Manipulation

List host file to command window:
type %WINDIR%\System32\Drivers\Etc\Hosts

Add entry to host file:
echo (IP ADDRESS) (DNS NAME) >> %WINDIR%\System32\Drivers\Etc\Hosts

Example:
echo 8.8.8.8 google.com >> %WINDIR%\System32\Drivers\Etc\Hosts

TimeZone

Set-TimeZone -Id "Eastern Standard Time"

ROBOCOPY

Powershell script to use RoboCopy for bulk deletion:

$pathEmpty = "C:\EMPTY"
$pathTarget = "C:\TARGET FOLDER"
robocopy $pathEmpty $pathTarget /purge




Newest Post