Skip to main content

Windows

Recovery

WinRE (Windows Recovery Environment)

Ref: Recovery options in Windows

Shift + Restart

System image

Use to backup / restore OS

System image

Control panel

  • Input control panel in Start search
  • Run control

Startup

Ref: Change which apps run automatically at startup in Windows

User Startup folder

Open in Run or Explorer

shell:startup

Open in command

start shell:startup

All Users Startup folder

Open in Run or Explorer

shell:common startup

Open in PowerShell

start "shell:common startup"

User

User Account Management / Auto Login

netplwiz.exe

Computer Management / Local User

lusrmgr.msc

Create User

net user <user name> [<password>] /add
# PowerShell
New-LocalUser <user name> [-Password (Read-Host -AsSecureString) | -NoPassword]

Delete User

net user <user name> /delete
# PowerShell
Remove-LocalUser <user name>

Make password never expire

wmic UserAccount [where Name=<user name>] set PasswordExpires={True|False}

Using group policy

Computer Configuration > Windows Settings > Security Settings > Password Policy > Maximum password age > Set to 0

Group Policy

gpedit.msc

Remote Desktop

DescriptionCommand
Connect to remotemstsc [/v:<host>[:<port>]]
Toggle full screenCtrl + Alt + Break
List remote desktop sessionquery session
Attach remote desktop session to console (Screen)tscon <session ID> /dest:console

Hibernate

Ref: How to disable and re-enable hibernation on a computer that is running Windows

Ref: Powercfg command-line options

Enable / Disable hibernate (remove hiberfil.sys file)

powercfg { /hibernate | /h } [ on | off ]
powercfg { /hibernate | /h } /size <percent size>
powercfg { /hibernate | /h } /type { reduced | full }

.cab file

Extract .cab

expand <file.cab>

Create .cab

makecab <file> <file.cab>

Cortana

Disable Cortana in Windows 10

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f
## PowerShell
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -PropertyType DWord -Value 0 -Force

Enable Cortana in Windows 10

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /f
## PowerShell
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana"

Allow input unicode with Alt + +<Code>

Ref: How to enter Unicode characters in Microsoft Windows

reg add "HKCU\Control Panel\Input Method" /v "EnableHexNumpad" /t REG_SZ /d 1 /f

Enable / Disable the Local Built-In Administrator Account

Ref: Windows 7: Enable / Disable the Local Built-In Administrator Account

net user administrator /active:{yes|no}

Get OS Architecture (32-bit / 64-bit)

Ref: Get Windows System Information via WMI Command-line

wmic OS get OSArchitecture
## PowerShell
(Get-CimInstance Win32_OperatingSystem).OSArchitecture

SLP (System Locked Pre-installation) / SLIC (System License Internal Code)

Install license

slmgr.vbs -ilc <path>

Install product key

slmgr.vbs -ipk <product key>

Code page

Ref: chcp

chcp <code page>

Change active code page to UTF-8

chcp 65001

Cleanup

Cleanup WinSxS

Ref: Clean Up the WinSxS Folder

Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
Dism.exe /online /Cleanup-Image /SPSuperseded

Cleanup hibernate

Disable USB storage

Ref: How can I prevent users from connecting to a USB storage device?

Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\USBSTOR\ -Name Start -Value 4

Enable USB storage

Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\USBSTOR\ -Name Start -Value 3

Windows Features

& ([System.Environment]::SystemDirectory + "\OptionalFeatures.exe")

Windows Features

Install Windows Sandbox

Use Windows Features

or

Enable-WindowsOptionalFeature -Online -All -FeatureName Containers-DisposableClientVM

Windows 11 Processor Requirements

Ref: Windows Processor Requirements

For Windows 10

Add print to PDF printer

Mount a drive in a folder

  • Disk Management diskmgmt.msc
  • Change Drive Letter and Paths
  • Add
  • Mount in the following empty NTFS folder
diskpart
list volume
select volume <number>
assign [mount=<path>]

Mount a folder as a drive

subst X: <path>

Remove substituted

subst X: /D

Event

EventID
Power On6005
Power Off6006