windows tips and utilities

control userpasswords2 - Manage users and change passwords

systeminfo | less - Displays system uptime, along with other
information about your system

msinfo32.exe - Displays hardware, software, components and a bunch of other information about your computer

perfmon - Monitor processes and threads

perfmon /rel - Reliability monitor, timeline of crashes and events (Win7 only?)

tracert - Trace the network route to a given destination (traceroute equiv)

netstat - Display network connections

net <option> - List network shares (view), users (user), password
management (accounts), mounted drives (use)

procexp - utility to view details of processes

If clipboard stops working, try disconnecting Remote Desktop connections

TCPView - show the TCP and UDP ports of processes

To open User Policy Editor: %SystemRoot%\system32\secpol.msc /s
To open Group Policy Editor: %SystemRoot%\system32\gpedit.msc /s

WMI - run wbemtest.exe, namespace: root\cimv2, then enum classes (leave the field blank and select recursive radio button)

shutdown -i produces a built-in shutdown GUI to shut down remote machines

sfc /scannow - Run this command with XP CD in drive and it will compare core Windows files on CD with what's installed and replace any altered files with the original.

findstr (search for strings in files)

In excel, to keep a cell from being incremented during autofill, add a $ between the letter and number (e.g. A$1)

msconfig (from run menu) to manage services, startup apps and .ini files

If deleting a file is slow, empty the recycle bin

If Windows Explorer seems sluggish, turn off network shortcuts:
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRecentDocsNetHood = 1
or Explorer > Tools > Folder Options > View > Files and Folders > Automatically search for network folders and printers

Command prompt tips
* F7 to show command history
* Drag paths instead of typing/copying them
* To enable paste with right-click, Edit Properties, enable QuickEdit Mode on Options tab.
* To enable tab completion, edit registry in HKEY_CURRENT_USER/Software/Microsoft/Command Processor and set CompletionChar to REG_DWORD of 9
* 'start' runs a separate window to run a program (uses the default file association for a filename). /b runs without creating a new window.

%~dp0 - Current path (useful in batch files running from a flash drive)

Disable "Open File - Security Warning dialog" - Create environment variable SEE_MASK_NOZONECHECKS = 1,
or run gpedit.msc, User Configuration, Administrative Templates, Windows Components, Attachment Manager, enable Default risk level for file attachments and Do not preserve zone information in file attachments

Restart explorer - Go to shutdown dialog and hold down Ctrl-Alt-Shift while clicking Cancel button. To start it, Ctrl-Alt-Delete, Task Manager, File, New Task, "Explorer.exe"

Create sparse file - fsutil file createNew <filename> <size>

Windows Update reminder / auto-reboot settings - Run "gpedit.msc" go to Computer Configuration-Administrative Templates-Windows Components-Windows Update and enable "No auto-restart for logged in users..." and "Re-prompt for restart with scheduled installations".

To print out the contents of a folder:
tree "C:\Windows\system32\drivers" /A /F

In some applications like Word, AkelPad, holding down alt while selecting text will let you select columns.

To view the serial number: wmic bios get serialnumber
Model or make: wmic csproduct get name, identifyingnumber

Fast way to delete directory with thousands of files (via stackoverflow)
del /f/s/q foldername > nul
rmdir /s/q foldername

Updated Mar 07, 2024