Setting Up Windows
I recently installed Windows from scratch, and thought I would document the steps I took here. There are a number of little things I like to have on all my machines.
Windows Configuration
Installation Setup Notes
- It’s key to not connect to Wi-Fi when it begs you to, so that you can force it to give you a local account. That way, you have control over your user directory name.
- By default, Windows wants to send a lot of telemetry. Turn those off as desired.
Post-Install
First Steps
- Connect to Wi-Fi
- In Settings:
- Change the machine name
- Connect your user to your microsoft account
- Set mspaint as the default picture viewer
- Make sure Windows activated as Pro, not Home
- If necessary, put in the Pro key and re-activate
- Check for updates and run them
- Turn on Bitlocker, save the key in OneDrive
- Run
main.cpland turn off the trackpad when a mouse is attached - Run
sysdm.cpland give 4% of the drive to system restore points - Run
desk.cpland set the brightness/night-light features as desired
Device Manager
- Run
devmgmt.mscas Administrator - Look for any unknown devices, and find the missing drivers
- During this install, I only had one:
AMD AS4
- During this install, I only had one:
OneDrive
- Turn on Desktop, Pictures, Documents backup
- Run
taskschd.mscand check that the scheduled task(s) for OneDrive look reasonable. For this install, it looks fine (runs once a day if an internet connection is available).
Set Up Mapped Drives
I like to set a couple mapped drives for areas of my hard drive so that they
are easier to visit. For example, my J: drive maps to
C:\Users\rwtodd\source\repos, so most git repositories I have checked out
will live directly under the J: drive. It’s very convenient, especially
since cmd.exe doesn’t support a tilde (~) shortcut to %userprofile%.
Powershell does have the tilde, but for many uses I prefer to live in the
old-fashioned DOS prompt.
So there are two main ways to accomplish this. One is to list the drives in
the registry under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS
Devices. Another is to create a local logon script
(reference).
I never use the registry option because it only seems to work for HKLM,
when these drives are specific to my user.
- Create the necessary
%systemroot%\System32\Repl\Import\Scriptsdirectory as Administrator. - Put the login script below in that directory.
- Run
lusrmgr.mscto set the login script for my user, using only the file name since the path is assumed. - Log out and in again, to test it.
subst H: /D
subst J: /D
subst H: C:\Users\rwtodd
subst J: C:\Users\rwtodd\source\repos
Install Programs
During the setup I’m describing here, I downloaded software packages manually, but since then I’ve started using Chocolatey for many of the packages. I’ve added annotations below for the chocolatey packages I use now.
Edge-Chromium
- For this, just open Edge “classic”, and it will almost certainly tell you about chredge. Install it.
- Sign in to chredge, and it should sync up your extensions etc.
- Run
taskschd.mscand adjust the Edge update tasks so that they run once a week instead of once an hour (!!)
Windows Terminal
- This comes from the Microsoft Store.
- Add EGA colors as described in my older post
- Set
cmd.exeas the default shell - Set %PROMPT% to
[$E[32m$P $E[1;33m$T$E[0m]$_$$$S(see ss64.com for reference)
Git
- I don’t use chocolatey for Git.
- Download the Git installer from https://git-scm.com/download/win
- When it asks about an editor, point it to vim.
- Run the global config:
git config --global user.name "Richard Todd"
git config --global user.email "rwtodd@users.noreply.github.com"
SSH Keys
- It looks like OpenSSH is just installed by default on windows these days. If it’s not, go to “optional windows features” and add it.
- Put public and private keys in
%USERPROFILE%\.ssh.- It’s kind of picky about line endings and final newlines, so try it out and adjust the key-files as needed.
Vim
choco install vim --params "'/NoContextmenu /NoDesktopShortcuts'"- Clone
git@github.com:rwtodd/dot-vim.gitinto%USERPROFILE%\vimfiles - Run
git submodule update --initto get the embedded packages
Emacs
choco install emacs- Clone
git@github.com:rwtodd/emacs-dot-dto%APPDATA%\.emacs.d - In emacs:
M-x package-refresh-contentsM-x package-install-selected-packagesC-u 0 M-x byte-recompile-directoryon.emacs.d\rwt-lisp
Misc Apps
Most of the data I care about is either in a backed-up git repository, or on my OneDrive. So, all I have left to do is to install the applications I use on Windows regularly. These are:
- Powershell 7, via chocolatey powershell-core
- 7-zip via chocolatey 7zip
- Foobar2000 via chocolatey foobar2000
- SumatraPDF via chocolatey sumatraPDF
- Set it as the default PDF and Epub reader
- VLC Player via chocolatey vlc
- FFmpeg via website
- ScummVM
- Set the savegame directory to OneDrive
- DosBox via chocolatey dosbox
- Mesen NES Emulator via website
- ImageMagick via website
64-bit 8-bit DLL version
- Also get Ghostscript GPL version for magick.exe PDF support
- WinSCP for FTP, via chocolatey winscp
- Visual Studio Community Edition
- MS Office
- MS Todo from the Microsoft Store
Command-Line Reference
The following are quick ways to get to various controls in Windows, rather than clicking through everything. I use them often when first setting up a machine.
| Command | Controls |
|---|---|
| appwiz.cpl | Classic uninstall program menu |
| control admintools | Opens a list of administrative tools |
| control desktop | Background image |
| desk.cpl | Screen resolution/brightness |
| lusrmgr.msc | Local user manager |
| mmsys.cpl | Sound controls |
| sysdm.cpl | System Properties |
| taskschd.msc | Task Scheduler |