Loading...
Loading...
Marco Franssen

Recently, I tried to reinstall Windows on my laptop using my WinPE approach, as it no longer had an optical drive. Unfortunately, my WinPE image was missing the laptop's network driver. I recreated the USB drive using the Windows 10 ADK, hoping it would include the required driver. No luck: I still had no network connection when I booted from the new Windows 10 PE USB drive. So I had to add the driver to the WinPE image before I could start the Windows 10 installation from my shared network folder.
Before starting the reinstall, I first checked which drivers were installed. On Windows, you can find information about your drivers and devices using msinfo32.
To launch it, press the Windows key on your keyboard and type msinfo32.
Browse to Components -> Network -> Adapter. You'll find a list of all network adapters here. Scroll down to your Ethernet adapter and note the driver name and device name so you can download the appropriate Windows 10 driver. In my case, the network device looked like this:
(NIC)Name [00000007] Intel(R) 82579LM Gigabit Network Connection
PNP Device ID PCI\VEN_8086&DEV_1502&SUBSYS_21CE17AA&REV_04\3&E89B380&0&C8
Driver c:\windows\system32\drivers\e1d65x64.sysWith this information, you can visit Intel's website or your laptop vendor's website to find the correct Windows 10 drivers. Download them so we can add them to our WinPE image later.
In my case, the package contained a few subfolders with drivers for Windows 7, 8, 8.1, and 10:
We're going to add the driver named e1d65x64.inf from the NDIS65 folder to our WinPE image. The downloaded folder contained multiple versions, so I chose the one whose name matched the driver previously installed on my Windows 10 system.
Download the Windows 10 ADK and install it on your computer. Then open Deployment and Imaging tools environment as an administrator. On Windows 10, press the Windows key and start typing to find it.
copype amd64 C:\winpe_amd64_win10
Dism /Mount-Image /ImageFile:"C:\winpe_amd64_win10\media\sources\boot.wim" /index:1 /MountDir:"C:\winpe_amd64_win10\mount"
Dism /Add-Driver /Image:"C:\winpe_amd64_win10\mount" /Driver:"C:\DRIVERS\WIN\ETHERNET\PRO1000\Winx64\NDIS65\e1d65x64.inf"
Dism /Unmount-Image /MountDir:"C:\winpe_amd64_win10\mount" /commit
MakeWinPEMedia /UFD E:\winpe_amd64_win10 F:Now I could finally start the installation using the Windows setup files on my network share. Windows PE gives you a command prompt, so I used it to check whether the network driver added to the image gave me a working connection.
ipconfig
ping 192.168.0.2Once I knew I had a network connection and could reach the computer hosting my share, I used net use to connect to it. Then I switched to the newly mapped network drive and ran the Windows 10 setup.
net use z: \\192.168.0.2\Win10
z:
setup.exeVoilà, your Windows 10 installation will now start! Stay connected with the network cable until the first reboot; after that, you can switch to Wi-Fi. The Windows 10 installation will take care of setting up your Wi-Fi network adapter. Give it a few minutes to get you fully up and running.
The first thing I usually do is set up Chocolatey, a package manager for Windows. It lets you install and update software from the command line, much like Homebrew for macOS or apt for Ubuntu. To install Chocolatey, run the installation command from its website.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"With Chocolatey installed, open PowerShell as an administrator (right-click -> Run as Administrator). I wouldn't be me if I hadn't prepared a PowerShell script listing all my desired software so I could install it easily.
To see which software is available, browse Chocolatey packages.
Here's an extract from my personal script to give you an idea of how I get a fresh Windows installation ready within 45 minutes, without too many manual steps.
cinst -y git git-lfs vscode GoogleChrome slack docker-for-windows 7zip winscp docker-machine golang nodejs gradle intellijidea-community dotnetcore-sdk vlc Firefox gpg4win graphviz gradle jdk8 openjdk python python2 keepass mysql.workbench postmanIn my case, the list goes on and on until all my favorite developer tools are in place.
I deliberately install Git and vscode first so I can start cloning my repositories and running my Bash scripts in Git Bash. The script below, for example, installs my VS Code extensions.
EXTENSIONS=(
ms-vscode.go
ms-vscode.csharp
ms-vscode.powershell
ms-python.python
vscoss.vscode-ansible
editorconfig.editorconfig
eamodio.gitlens
esbenp.prettier-vscode
vsmobile.vscode-react-native
dsznajder.es7-react-js-snippets
peterjausovec.vscode-docker
ms-kubernetes-tools.vscode-kubernetes-tools
technosophos.vscode-make
secanis.jenkinsfile-support
eg2.vscode-npm-script
christian-kohler.npm-intellisense
sonarsource.sonarlint-vscode
djabraham.vscode-yaml-validation
redhat.vscode-yaml
)
for ext in ${EXTENSIONS[@]} ; do
code --install-extension $ext
doneOnce you've installed your desired software using Chocolatey, you can keep it updated with the following PowerShell commands.
choco outdatedcup all -ycup docker slack -yIf you ever want to uninstall a piece of software, you can list your installed software and run the uninstall command.
clist --lochoco uninstall -y virtualboxI didn't go through the hassle of getting Wi-Fi working in my WinPE image. I figured it would involve more work than I wanted to spend on it, especially since I had access to a cable anyway. I'm looking forward to your tips and tricks in the comments!
Marco Franssen
Explore Go's defer with practical examples of execution order, panic and recover, recursive calls, and closing a file after reading its contents.
Marco Franssen
Set up your first Go project on Windows, learn basic syntax, write and run tests, and cross-compile a simple application for Linux and Raspberry Pi.
Marco Franssen
Combine separate Git repositories into a multi-module Gradle project while preserving commit history, then consolidate build and CI configuration.
Marco Franssen
Explore responsive and adaptive web design, progressive web apps and how I improved my blog with a static site, caching, manifests and service workers.