CLI
Common Commandsβ
About
Some frequently used command that comes in handy.
To know more, you can run:
- cmd
- powershell
help
Get-Command
Create user profileβ
- Run the ff: command to determine your profile path:
$profile
-
Create a file name
Microsoft.PowerShell_profile.ps1
-
Alternatively, you can download this example.
Enable / Disable - Superadminβ
More
Net user administrator /active:yes
Net user administrator /active:no
Networkβ
Note
This requires elevated / admin access and must be execute in the exact order.
Here's an extended command that might be helpful in fix issues with network.
ipconfig /release
ipconfig /flushdns
ipconfig /renew
netsh int ip reset
netsh winsock reset
Restart comupter.
Status and Reports
netsh interface show interface
netsh wlan show wlanreport
netsh interface ip show dnsservers
Local Machineβ
Check for disk errors
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup /RestoreHealth
Upgradesβ
Note
This only applies for Windows 10 only.
Pro to Enterprise (Windows 10)β
STEP 1 - Run cmd as administrator
slmgr /ipk {choose_license_key_below}
Edition | Product Key |
---|---|
Professional | W269N-WFGWX-YVC9B-4J6C9-T83GX |
Professional N | MH37W-N47XK-V7XM9-C7227-GCQG9 |
Education | NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 |
Education N | 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ |
Enterprise | NPPR9-FWDCX-D2C8J-H872K-2YT43 |
Enterprise N | DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4 |
STEP 2 - Connect to KMS server
slmgr /skms kms8.msguides.com
STEP 3 - Activation
slmgr /ato
STEP 4 - Confirm activation via winver
using run.
Office 2021 LTSCβ
STEP 1 - Run cmd as administrator
cd C:\Program Files\Microsoft Office\Office16
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
OPTIONAL: This optional step only applies if you don't have a Volume license installed in your machine.
for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"
STEP 2 - Activate
cscript ospp.vbs /setprt:1688
cscript ospp.vbs /unpkey:6F7TH >nul
cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
cscript ospp.vbs /sethst:e8.us.to
cscript ospp.vbs /act
Check License
For OEM.
wmic path softwarelicensingservice get OA3xOriginalProductKey
- For Volumes. Check Host.
slmgr.vbs /dli
- Disable KMS host caching:
slmgr.vbs /ckhc
- Enable KMS host cahing:
slmgr.vbs /skhc