{"id":21689086,"url":"https://github.com/tinram/windows-survival","last_synced_at":"2025-03-20T12:36:41.853Z","repository":{"id":83640128,"uuid":"125527704","full_name":"Tinram/Windows-Survival","owner":"Tinram","description":"Survival cheatsheet when forced to develop in Windows World.","archived":false,"fork":false,"pushed_at":"2021-02-16T23:27:10.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T12:41:48.199Z","etag":null,"topics":["cheatsheet","hateful","survival","telemetry","windows","windows-survival","windows10"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tinram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-16T14:31:55.000Z","updated_at":"2021-02-16T23:27:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"d74c959f-dfc3-4b2b-8afc-1231aaef0f42","html_url":"https://github.com/Tinram/Windows-Survival","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinram%2FWindows-Survival","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinram%2FWindows-Survival/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinram%2FWindows-Survival/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinram%2FWindows-Survival/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tinram","download_url":"https://codeload.github.com/Tinram/Windows-Survival/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244611759,"owners_count":20481258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheatsheet","hateful","survival","telemetry","windows","windows-survival","windows10"],"created_at":"2024-11-25T17:21:02.150Z","updated_at":"2025-03-20T12:36:41.829Z","avatar_url":"https://github.com/Tinram.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Windows Survival\r\n\r\n#### Survival snippets for development on Windows.\r\n\r\n#### *Developing on Windows?!*\r\n\r\nDespite detesting so much of this wretched OS, I am sometimes forced to use it for on-site work.\r\n\r\nThis is a quick personal reference to work around some of the pain of Windows world.\r\n\r\n\r\n----\r\n\r\n#### [Active Directory](#ad)\r\n#### [Clean-up](#cu)\r\n#### [Command-Line](#cl)\r\n#### [Commands](#cs)\r\n#### [/dev/null](#dn)\r\n#### [Editors](#ed)\r\n#### [Diff Folders](#df)\r\n#### [Drive Mapping](#dm)\r\n#### [Essential Programs](#ep)\r\n#### [File Transfer](#ft)\r\n#### [Keys](#ks)\r\n#### [Hosts](#hs)\r\n#### [.msc](#mc)\r\n#### [Passwords](#pw)\r\n#### [Power Configuration](#pc)\r\n#### [Program Installation Folders](#pf)\r\n#### [sendto](#st)\r\n#### [Servers](#sv)\r\n#### [Services](#sc)\r\n#### [Start Batch](#sb)\r\n#### [Taskbar](#tb)\r\n#### [Telemetry](#tm)\r\n#### [Updates](#ud)\r\n#### [Windows](#wd)\r\n#### [Windows Explorer](#we)\r\n\r\n\r\n----\r\n\r\n\r\n\u003ca id=\"ad\"\u003e\u003c/a\u003e\r\n## Active Directory\r\n\r\nCorporate environments love Active Directory (AD). I don't.\r\n\r\nAD periodically copies files from *My Documents* and adds them to a remote network server(s).\r\n\r\nFor corporate PC roaming file access you might want this, else you probably won't.\r\n\r\nIf not, move personal files out of *My Documents* to another location, such as `C:/mydocs`\r\n\r\n\u0026ndash; which will then rely on your backup schedule, not AD's (not that I found AD's consistent anyway).\r\n\r\n\r\n\u003ca id=\"cu\"\u003e\u003c/a\u003e\r\n## Clean-up\r\n\r\n+ [CCleaner](https://www.ccleaner.com/ccleaner/download)\r\n\r\n+ `C:\\Users\\\u003cusername\u003e\\AppData\\Roaming\\`\r\n\r\n+ `C:\\Users\\\u003cusername\u003e\\AppData\\Roaming\\Skype\\\u003cskype_name\u003e\\xxxx-journal`\r\n\r\n+ `putty -cleanup` (wipe session data)\r\n\r\n\r\n\u003ca id=\"cl\"\u003e\u003c/a\u003e\r\n## Command-Line\r\n\r\nFor a resized terminal window on Windows \u003c 10\r\n\r\n```batch\r\n    mode con cols=140\r\n```\r\n\r\nChange encoding:\r\n\r\n```batch\r\n    chcp 650001        Unicode\r\n    chcp 1252          Latin 1\r\n```\r\n\r\n#### Open terminal in current folder:\r\n\r\n+ current directory (nothing selected) \u003e \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eright click\u003c/kbd\u003e \u003e *Open command window here*\r\n\r\n#### Registry hack:\r\n\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `regedit`\r\n+ `HKEY_LOCAL_MACHINE\\Software\\Classes\\Folder\\Shell\\`\r\n+ create new key called `Command Prompt`\r\n+ default value: `cmd`\r\n+ create new key below `Command Prompt` called `Command`\r\n+ default value: `cmd.exe /k \"pushd %L\"`\r\n\r\n\r\n\u003ca id=\"cs\"\u003e\u003c/a\u003e\r\n### Commands\r\n\r\n#### A few network and file commands.\r\n\r\ncommand | description | |\r\n---- | ---- | ---- |\r\n`comp` | compare two files | |\r\n`fc` | file contents compare | |\r\n`find` | text string in file | `/n` line nums, `/c` line count |\r\n`findstr` | string search in file | `findstr /si password *.txt` |\r\n`fsutil` | file utils | `fsutil file createnew \u003cf\u003e 1024` null chars |\r\n`getmac` | MAC address | |\r\n`hostname` | | |\r\n`ipconfig` | IPs | |\r\n`more` | pager | |\r\n`mstsc` | RDP | |\r\n`net` | network info | |\r\n`netsh` | netshell | `netsh interface ip set address local dhcp` |\r\n`netstat` | network stats | `-a` all, `-b` exes, `-o` owner, `-p` TCP, `-r` routing, `-s` stats |\r\n`net use` | network connections | |\r\n`path` | search path | |\r\n`pathping` | network ping stats | |\r\n`ping` | | |\r\n`ren` | rename | |\r\n`route` | routing table | |\r\n`sort` | sort text | `-r` reverse |\r\n`start` | exe or cmd | |\r\n`systeminfo` | | |\r\n`taskkill` | | |\r\n`tracert` | | |\r\n`tree` | dirs | `tree /F /A` |\r\n`type` | view text file | |\r\n`unzip` | | |\r\n`where` | file locator | |\r\n`xcopy` | file / dir copy | |\r\n\r\n\r\n\u003ca id=\"dn\"\u003e\u003c/a\u003e\r\n## /dev/null\r\n\r\n**A bitbucket**\r\n\r\n*p* = program\r\n\r\n```batch\r\n    p \u003e nul\r\n    p 2\u003e nul             error to nul\r\n    p \u003e nul 2\u003e\u00261         error + out\r\n    p \u003ef 2\u003e nul          out to file, suppress error\r\n    (p) \u003e f 2\u003e nul       out to file, suppress cmd.exe error\r\n```\r\n\r\n\r\n\u003ca id=\"ed\"\u003e\u003c/a\u003e\r\n## Editors\r\n\r\nJust 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.)\r\n\r\n\r\n\u003ca id=\"df\"\u003e\u003c/a\u003e\r\n## Diff Folders\r\n\r\n```batch\r\n    ROBOCOPY cmp cmp2 /e /l /ns /njs /njh /ndl /fp /log:diff.txt\r\n```\r\n\r\n\u003ca id=\"dm\"\u003e\u003c/a\u003e\r\n## Drive Mapping\r\n\r\n    \\\\10.0.0.147\r\n\r\n\r\n\u003ca id=\"ep\"\u003e\u003c/a\u003e\r\n## Essential Programs\r\n\r\n+ [Git](https://git-scm.com/download/win)\r\n    + not just for *Git*, but for what ships with it:\r\n        + *curl*\r\n        + *gpg*\r\n        + *grep*\r\n        + *md5sum*\r\n        + *openssl*\r\n        + *shred*\r\n        + *ssh*\r\n\r\n+ [7-Zip](https://www.7-zip.org/)\r\n+ [CherryTree](https://www.giuspen.com/cherrytree/)\r\n+ diff program ([CSDiff](http://www.componentsoftware.de/Products/CSDiff/download.htm), [WinMerge](http://winmerge.org/) etc)\r\n+ password vault ([KeePassX](https://www.keepassx.org/downloads))\r\n+ PDF viewer ([SumatraPDF](https://www.sumatrapdfreader.org/free-pdf-reader.html))\r\n+ [ptime](http://pc-tools.net/win32/ptime/)\r\n+ [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)\r\n+ [WinSCP](https://winscp.net/eng/index.php)\r\n\r\n### Standalone Programs\r\n\r\nAdd standalone programs to `C:/\u003cdirectory\u003e`, and add this directory location to *$PATH*, so the programs are available on the command-line from any location.\r\n\r\n\r\n\u003ca id=\"ft\"\u003e\u003c/a\u003e\r\n## File Transfer\r\n\r\n**Easy Way**\r\n\r\n### Win 10\r\n\r\n+ *ssh*, *scp*\r\n\r\n### Win 7\r\n\r\n+ local server upload, *netcat*, *WinSCP*, network storage, online storage ...\r\n\r\n**Hard Way**\r\n\r\n### Win 7\r\n\r\n+ *Network and Sharing Center*, enable:\r\n    + network discovery\r\n    + file and printer sharing\r\n    + public folder sharing\r\n\r\n### Win XP\r\n\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `services.msc` \u003e *Server*, *Computer Browser* (required)\r\n+ Firewall \u003e exceptions \u003e *File and Printer Sharing* \u003e enable\r\n\r\n\r\n\u003ca id=\"ks\"\u003e\u003c/a\u003e\r\n## Keys\r\n\r\n### \u003ckbd\u003eWindows\u003c/kbd\u003e + ...\r\n\r\nkeys | purpose |\r\n---- | ---- |\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003ePrtScrn\u003c/kbd\u003e | screenshot of active window |\r\n\u003ckbd\u003eBreak\u003c/kbd\u003e | system properties |\r\n\u003ckbd\u003eE\u003c/kbd\u003e | Explorer |\r\n\u003ckbd\u003eF3\u003c/kbd\u003e | file search |\r\n\u003ckbd\u003eL\u003c/kbd\u003e | lock |\r\n\u003ckbd\u003eM\u003c/kbd\u003e | minimise windows |\r\n\u003ckbd\u003eP\u003c/kbd\u003e | projector |\r\n\u003ckbd\u003eR\u003c/kbd\u003e | run |\r\n\u003ckbd\u003eR\u003c/kbd\u003e | \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eEnter\u003c/kbd\u003e = admin |\r\n\u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eL-Alt\u003c/kbd\u003e + \u003ckbd\u003ePrtScrn\u003c/kbd\u003e | high contrast |\r\n\r\n\r\n### Others\r\n\r\nkeys | purpose |\r\n---- | ---- |\r\n\u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eright click\u003c/kbd\u003e | open terminal |\r\n\u003ckbd\u003eF2\u003c/kbd\u003e | rename |\r\n\u003ckbd\u003eF3\u003c/kbd\u003e | search |\r\n\u003ckbd\u003eF5\u003c/kbd\u003e | refresh\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eTAB\u003c/kbd\u003e | cycle windows |\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eTAB\u003c/kbd\u003e | cycle backwards |\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eESC\u003c/kbd\u003e | taskmanager |\r\n\r\n\r\n\u003ca id=\"hs\"\u003e\u003c/a\u003e\r\n## Hosts\r\n\r\n    C:\\windows\\system32\\drivers\\etc\\hosts\r\n\r\nCreate shortcut:\r\n\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `notepad /A \u003cpath\u003e`\r\n+ \u003ckbd\u003eright click\u003c/kbd\u003e \u003e *Run as administrator*\r\n\r\n\r\n\u003ca id=\"mc\"\u003e\u003c/a\u003e\r\n## .msc\r\n\r\n.msc | description |\r\n---- | ---- |\r\n`compmgmt.msc` | computer management |\r\n`devmgmt.msc` | device manager |\r\n`diskmgmt.msc` | disk manager |\r\n`eventvwr.msc`| event viewer |\r\n`fsmgmt.msc` | shared folders |\r\n`gpedit.msc` | group policy |\r\n`lusrmgr.msc` | local users / groups |\r\n`ntmsmgr.msc` | removable storage |\r\n`ntmsoprq.msc` | \" |\r\n`perfmon.msc` | performance |\r\n`secpol.msc` | security |\r\n`services.msc` | services |\r\n`wf.msc` | firewall |\r\n`wmimgmt.msc` | WMI |\r\n\r\n----\r\n\r\n.cpl | description |\r\n---- | ---- |\r\n`nusrmgr.cpl` | user accounts |\r\n`firewall.cpl` | |\r\n\r\n\r\n\u003ca id=\"pw\"\u003e\u003c/a\u003e\r\n## Passwords\r\n\r\n\u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `rundll32.exe keymgr.dll,KRShowKeyMgr`\r\n\r\n\r\n\u003ca id=\"pc\"\u003e\u003c/a\u003e\r\n## Power Configuration\r\n\r\n\u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `regedit`\r\n\r\n    HKEY_CURRENT_USER\\Control Panel\\PowerCfg \u003e CurrentPowerPolicy\r\n        0  home office\r\n        3  always on\r\n        4  minimal management\r\n\r\n(Win 7 Pro: bugs prevent the above working.)\r\n\r\n\u003ca id=\"pf\"\u003e\u003c/a\u003e\r\n## Program Installation Folders\r\n\r\n(theoretical, Windows doesn't usually care)\r\n\r\n    \\Program Files (x86)\\     x32\r\n    \\Program Files\\           x64\r\n\r\n\r\n\u003ca id=\"st\"\u003e\u003c/a\u003e\r\n## sendto\r\n\r\n    %APPDATA%\\Microsoft\\Windows\\SendTo\r\n\r\nor\r\n\r\n\u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `shell:sendto`\r\n\r\n\r\n\u003ca id=\"sv\"\u003e\u003c/a\u003e\r\n## Servers\r\n\r\n+ [WAMP](http://www.wampserver.com/en/)\r\n    + x64, x32, multiple PHP versions\r\n\r\n+ [XAMPP](https://www.apachefriends.org/download.html)\r\n    + x32, ancient PHP versions available\r\n\r\n### IIS Conflict\r\n\r\nKill IIS when it stops WAMP / XAMPP:\r\n\r\n+ Control Panel \u003e Admin Tools \u003e IIS Manager \u003e stop\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `services.msc` \u003e *Web Deployment Agent Service* \u003e *manual start*\r\n\r\n\r\n\u003ca id=\"sc\"\u003e\u003c/a\u003e\r\n## Services\r\n\r\n+ DCOM Server Process Launcher: defragging\r\n+ Diagnostics Tracking Service: telemetry\r\n\r\n\r\n\u003ca id=\"sb\"\u003e\u003c/a\u003e\r\n## Start Batch\r\n\r\n1. *start.bat*\r\n\r\n```batch\r\n    @echo off\r\n    start cherrytree.exe\r\n    start firefox.exe\r\n    exit\r\n```\r\n\r\n2. add the program locations in *start.bat* to *$PATH*\r\n\r\n\r\n\u003ca id=\"tb\"\u003e\u003c/a\u003e\r\n## Taskbar\r\n\r\n### Thumbnail Preview Disable\r\n\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `gpedit.msc` \u003e User Configuration \u003e Administrative Templates \u003e Start Menu and Taskbar \u003e *Turn off taskbar thumbnails* \u003e Disabled\r\n\r\n+ `HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced`\r\nnew DWORD \u003e ExtendedUIHoverTime \u003e 30000\r\n\r\n(Both disabled by Win 10 Creators Update ... sigh.)\r\n\r\n\r\n\u003ca id=\"tm\"\u003e\u003c/a\u003e\r\n## Telemetry\r\n\r\n### Win 10\r\n\r\n+ Start \u003e Settings \u003e Privacy\r\n    + disable as many as possible, *especially* **Inking**\r\n\r\n#### Disable Services\r\n\r\n+ DiagTrack\r\n+ Connected User Experience and Telemetry\r\n\r\n#### Disable via Registry\r\n\r\n```batch\r\n    sc delete DiagTrack\r\n    sc delete dmwappushservice\r\n    echo \"\" \u003e C:\\ProgramData\\Microsoft\\Diagnosis\\ETLLogs\\AutoLogger\\AutoLogger-Diagtrack-Listener.etl\r\n    reg add \"HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" /v AllowTelemetry /t REG_DWORD /d 0 /f\r\n```\r\n\r\n\r\n\u003ca id=\"ud\"\u003e\u003c/a\u003e\r\n## Updates\r\n\r\n### Win 7 Bad Updates\r\n\r\n1. disable Win 10 upgrade path:\r\n\r\n+ `HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate`\r\nDisableOSUpgrade \u003e 1\r\n\r\n+ `HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\OSUpgrade`\r\nReservationsAllowed \u003e 0\r\n\r\n2. *KB3133977*, March 2016\r\n    + prevents booting, looks like hard drive failure\r\n    + remedy: disable UEFI secure boot; OS Type \u003e Other OS\r\n\r\n### Borked Updates\r\n\r\n*Updates jammed / Updates Service disabled error*\r\n\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `services.msc` \u003e stop *WindowsUpdate*\r\n+ `C:\\Windows\\` \u003e rename `SoftwareDistribution` directory\r\n+ \u003ckbd\u003eWindows\u003c/kbd\u003e + \u003ckbd\u003eR\u003c/kbd\u003e \u003e `services.msc` \u003e start *WindowsUpdate*\r\n\r\n\r\n\u003ca id=\"wd\"\u003e\u003c/a\u003e\r\n## Windows\r\n\r\n### Unreachable Offscreen\r\n\r\n+ `right click` window on taskbar, or select it and use \u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eSpace\u003c/kbd\u003e\r\n+ if `Restore` option available, select it to get window out of minimised/maximised state\r\n+ `Move`\r\n+ cursor\r\n+ move mouse\r\n\r\n\r\n\u003ca id=\"we\"\u003e\u003c/a\u003e\r\n## Windows Explorer\r\n\r\n### Kill and Reboot\r\n\r\n```batch\r\n    taskkill /f /im explorer.exe\r\n    start explorer.exe\r\n```\r\n\r\n\r\n## License\r\n\r\nLicensed under the [MIT License](https://github.com/Tinram/Windows-Survival/blob/master/LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinram%2Fwindows-survival","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinram%2Fwindows-survival","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinram%2Fwindows-survival/lists"}