Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

45 total results found

Code Snippets

Snippets of code from various sources

PowerShell
Bash
Windows Command Line

Windows Command Line

Windows Command Line

Battery Test

Windows Command Line

WMIC PATH Win32_Battery Get EstimatedChargeRemaining Or powercfg /batteryreport /OUTPUT "c:\Admin\batteryreport.html"

Windows Command Line

Check the state of Windows Activation

Windows Command Line

slmgr.vbs /xpr   Typical Output:

Windows Command Line

Windows Command Line Firewall Commands

Windows Command Line

To Turn Off: NetSh Advfirewall set allprofiles state off NetSh Advfirewall set domainprofile state off To Turn On: NetSh Advfirewall set allprofiles state on NetSh Advfirewall set domainprofile state on To check the status of Windows Fire...

Windows Command Line
Networking

Disable IPV6

Windows Command Line

Commands to disable IPV6 netsh interface teredo set state disabled netsh interface ipv6 6to4 set state state=disabled undoonstop=disabled netsh interface ipv6 isatap set state state=disabled

Windows Command Line
Networking

Disable LLMNR

Windows Command Line

From and elevated Command Line REG ADD “HKLM\Software\policies\Microsoft\Windows NT\DNSClient” REG ADD “HKLM\Software\policies\Microsoft\Windows NT\DNSClient” /v ” EnableMulticast” /t REG_DWORD /d “0” /f

Windows Command Line
Networking

Find Public IP from Command Line

Windows Command Line

nslookup myip.opendns.com resolver1.opendns.com

Windows Command Line
Networking

Get WiFi Password

Windows Command Line

List all known WiFi Networks   netsh wlan show profiles Show password for a known WiFi Network netsh wlan show profile name={wifiname} key=clear  

Windows Command Line
Networking

Lock Computer

Windows Command Line

rundll32.exe user32.dll,LockWorkStation

Windows Command Line

Map a drive as a different user

Windows Command Line

Map a drive net use y: \\server-1\cpas /USER:server-1\famme @TimeSheets /PERSISTENT:YES Delete a mapped drive net use y: /delete

Windows Command Line

Windows Memory Information

Windows Command Line

For Total Physical Memory wmic ComputerSystem get TotalPhysicalMemory For Available Physical Memory wmic OS get FreePhysicalMemory Capacity of each bank wmic memorychip get capacity

Windows Command Line

Stop Windows from Sleeping

Windows Command Line

powercfg -change -standby-timeout-ac 0

Windows Command Line

Rebuild Windows Search Database

Windows Command Line

This is a CMD file and when run stop the Windows Search and force a rebuild of the database. sc config wsearch start= disabled net stop wsearch REG ADD "HKLM\SOFTWARE\Microsoft\Windows Search" /v SetupCompletedSuccessfully /t REG_DWORD /d 0 /f del "%Progra...

Windows Command Line

Remove Corrupted Recycle Bin

Windows Command Line

Run from an elevated Command Line rd /s /q C:\$Recycle.Bin

Windows Command Line

Time Zone Commands

Windows Command Line

List All Time Zones tzutil /l List Current Time Zone tzutil /g Set Time Zone tzutil /s "Eastern Standard Time"

Windows Command Line

Turn on the Windows Admin Share

Windows Command Line

This is executed from an elevated Command Line REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Windows Command Line
Networking

Turn on File/Folder Inheritance

Windows Command Line

The code snippet below turns on File/Folder inheritance recursively from the current position This is to be run from an elevated Command Line icacls "*" /q /c /t /reset

Windows Command Line

Unexpected Shutdown Message will not go away

Windows Command Line

This occurs when the Dirty Shutdown flag in Windows does not go away and displays the dialog every login Run as Administrator with an elevated Command Line REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability /v DirtyShutdown /t REG_DWORD /d 0 ...

Windows Command Line

Update Microsoft Office without a Windows Online Username

Windows Command Line

This will initiate the update of Microsoft Office without logging into Microsoft These commands are executed from an elevated Command Line With GUI "C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user Headless "C:\P...

Windows Command Line

Windows Computer Uptime

Windows Command Line

Both of these commands will display the uptime for the current computer systeminfo | find "System Boot Time:" or net statistics workstation |find "Statistics since"

Windows Command Line

Display Windows License Information

Windows Command Line

Run from Command Line slmgr -dli

Windows Command Line
Licensing