Despite detesting so much of this wretched OS, I am sometimes forced to use it for on-site work.
This is a quick personal reference to work around some of the pain of Windows world.
Corporate environments love Active Directory (AD). I don't.
AD periodically copies files from My Documents and adds them to a remote network server(s).
For corporate PC roaming file access you might want this, else you probably won't.
If not, move personal files out of My Documents to another location, such as C:/mydocs
– which will then rely on your backup schedule, not AD's (not that I found AD's consistent anyway).
-
C:\Users\<username>\AppData\Roaming\
-
C:\Users\<username>\AppData\Roaming\Skype\<skype_name>\xxxx-journal
-
putty -cleanup
(wipe session data)
For a resized terminal window on Windows < 10
mode con cols=140
Change encoding:
chcp 650001 Unicode
chcp 1252 Latin 1
- current directory (nothing selected) > Shift + right click > Open command window here
- Windows + R >
regedit
HKEY_LOCAL_MACHINE\Software\Classes\Folder\Shell\
- create new key called
Command Prompt
- default value:
cmd
- create new key below
Command Prompt
calledCommand
- default value:
cmd.exe /k "pushd %L"
command | description | |
---|---|---|
comp |
compare two files | |
fc |
file contents compare | |
find |
text string in file | /n line nums, /c line count |
findstr |
string search in file | findstr /si password *.txt |
fsutil |
file utils | fsutil file createnew <f> 1024 null chars |
getmac |
MAC address | |
hostname |
||
ipconfig |
IPs | |
more |
pager | |
mstsc |
RDP | |
net |
network info | |
netsh |
netshell | netsh interface ip set address local dhcp |
netstat |
network stats | -a all, -b exes, -o owner, -p TCP, -r routing, -s stats |
net use |
network connections | |
path |
search path | |
pathping |
network ping stats | |
ping |
||
ren |
rename | |
route |
routing table | |
sort |
sort text | -r reverse |
start |
exe or cmd | |
systeminfo |
||
taskkill |
||
tracert |
||
tree |
dirs | tree /F /A |
type |
view text file | |
unzip |
||
where |
file locator | |
xcopy |
file / dir copy |
A bitbucket
p = program
p > nul
p 2> nul error to nul
p > nul 2>&1 error + out
p >f 2> nul out to file, suppress error
(p) > f 2> nul out to file, suppress cmd.exe error
Just don't use Windows Notepad, which has one level of undo and no recognition of non-CRLF
line endings. (Probably just fine on Windows 1.0 in 1985.)
ROBOCOPY cmp cmp2 /e /l /ns /njs /njh /ndl /fp /log:diff.txt
\\10.0.0.147
-
- not just for Git, but for what ships with it:
- curl
- gpg
- grep
- md5sum
- openssl
- shred
- ssh
- not just for Git, but for what ships with it:
-
password vault (KeePassX)
-
PDF viewer (SumatraPDF)
Add standalone programs to C:/<directory>
, and add this directory location to $PATH, so the programs are available on the command-line from any location.
Easy Way
- ssh, scp
- local server upload, netcat, WinSCP, network storage, online storage ...
Hard Way
- Network and Sharing Center, enable:
- network discovery
- file and printer sharing
- public folder sharing
- Windows + R >
services.msc
> Server, Computer Browser (required) - Firewall > exceptions > File and Printer Sharing > enable
keys | purpose |
---|---|
Alt + PrtScrn | screenshot of active window |
Break | system properties |
E | Explorer |
F3 | file search |
L | lock |
M | minimise windows |
P | projector |
R | run |
R | Ctrl + Shift + Enter = admin |
Shift + L-Alt + PrtScrn | high contrast |
keys | purpose |
---|---|
Shift + right click | open terminal |
F2 | rename |
F3 | search |
F5 | refresh |
Alt + TAB | cycle windows |
Alt + Shift + TAB | cycle backwards |
Ctrl + Shift + ESC | taskmanager |
C:\windows\system32\drivers\etc\hosts
Create shortcut:
- Windows + R >
notepad /A <path>
- right click > Run as administrator
.msc | description |
---|---|
compmgmt.msc |
computer management |
devmgmt.msc |
device manager |
diskmgmt.msc |
disk manager |
eventvwr.msc |
event viewer |
fsmgmt.msc |
shared folders |
gpedit.msc |
group policy |
lusrmgr.msc |
local users / groups |
ntmsmgr.msc |
removable storage |
ntmsoprq.msc |
" |
perfmon.msc |
performance |
secpol.msc |
security |
services.msc |
services |
wf.msc |
firewall |
wmimgmt.msc |
WMI |
.cpl | description |
---|---|
nusrmgr.cpl |
user accounts |
firewall.cpl |
Windows + R > rundll32.exe keymgr.dll,KRShowKeyMgr
Windows + R > regedit
HKEY_CURRENT_USER\Control Panel\PowerCfg > CurrentPowerPolicy
0 home office
3 always on
4 minimal management
(Win 7 Pro: bugs prevent the above working.)
(theoretical, Windows doesn't usually care)
\Program Files (x86)\ x32
\Program Files\ x64
%APPDATA%\Microsoft\Windows\SendTo
or
Windows + R > shell:sendto
Kill IIS when it stops WAMP / XAMPP:
- Control Panel > Admin Tools > IIS Manager > stop
- Windows + R >
services.msc
> Web Deployment Agent Service > manual start
- DCOM Server Process Launcher: defragging
- Diagnostics Tracking Service: telemetry
- start.bat
@echo off
start cherrytree.exe
start firefox.exe
exit
- add the program locations in start.bat to $PATH
-
Windows + R >
gpedit.msc
> User Configuration > Administrative Templates > Start Menu and Taskbar > Turn off taskbar thumbnails > Disabled -
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
new DWORD > ExtendedUIHoverTime > 30000
(Both disabled by Win 10 Creators Update ... sigh.)
- Start > Settings > Privacy
- disable as many as possible, especially Inking
- DiagTrack
- Connected User Experience and Telemetry
sc delete DiagTrack
sc delete dmwappushservice
echo "" > C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
- disable Win 10 upgrade path:
-
HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
DisableOSUpgrade > 1 -
HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade
ReservationsAllowed > 0
- KB3133977, March 2016
- prevents booting, looks like hard drive failure
- remedy: disable UEFI secure boot; OS Type > Other OS
Updates jammed / Updates Service disabled error
- Windows + R >
services.msc
> stop WindowsUpdate C:\Windows\
> renameSoftwareDistribution
directory- Windows + R >
services.msc
> start WindowsUpdate
right click
window on taskbar, or select it and use Alt + Space- if
Restore
option available, select it to get window out of minimised/maximised state Move
- cursor
- move mouse
taskkill /f /im explorer.exe
start explorer.exe
Licensed under the MIT License.