Very recently I have been trying to reinstall my Laptop using my WinPE approach as it didn’t have a optical drive anymore. However my problem was that the WinPE image I created was lacking the network driver for my laptop. So then I recreated a WinPE USB drive using the Windows 10 ADK, hoping it would include the required driver. However unlucky me I still had no network when I booted by new laptop using my new Windows 10 PE USB drive. Therefore I had to add the network driver for my laptop to the WinPE image in order to be able to connect to the network and start my Windows 10 installation from my shared network folder.
Before starting the reinstall I first figure out what drivers are installed. On Windows you can find information about your drivers and your devices using
So simply fire up
msinfo32 by hitting the Windows key on your keyboard and type
Browse to Components -> Network -> Adapter. Here you will find a list of all network adapters. Scroll down to your Ethernet adapter and note down the driver name and the device name in order to download the appropriate Windows 10 driver. In my case the network device looked like this.
(NIC)Name  Intel(R) 82579LM Gigabit Network Connection
With this information you can now look at Intel’s or your laptop vendor webpage for the correct drivers for Windows 10. Download these so we can add them to our WinPE image later on.
In my case I got a package with a few subfolders (containing drivers for Win 7 Win 8 Win 8.1 and Win 10).
- NDIS62 –> Windows 7
- NDIS63 –> Windows 8
- NDIS64 –> Windows 8.1
- NDIS65 –> Windows 10
We are about to install the driver with the name
e1d65x64.inf from the NDIS65 folder to our WinPE image. In the folder I downloaded there where multiple versions, so I went for the one with the same name as it was installed previously on my Windows 10.
Download the Windows 10 ADK and install it on your computer. Now open as admin your
Deployment and Imaging tools environment (Just hit the windows key on your keyboard and start typing on Windows 10 to find it…).
copype amd64 C:\winpe_amd64_win10
Now I could finally start my installation using the Windows install files on my shared network location. So in Windows PE you will have a command prompt available. In the command prompt I checked if I had a network connection with the network driver build into the Windows PE image.
Now I am sure I have a network connection and I can also reach the computer hosting my share I can simply use
net use in order to connect to the network share. Then swich to this newly attached network drive and run the Windows 10 setup.
net use z: \\192.168.0.2\Win10
Voila, now your Windows 10 installation will start. Make sure you stay connected with the network cable until first reboot, from that point on you can switch to Wifi. The Windows 10 installation will take care of setting up your Wifi network adapter properly. Give it a couple of minutes to get you fully up and running.
First thing I usually do is getting Chocolatey setup. Chocolatey is a package manager for Windows. It allows you to easily install and update your software from the commandline. Similar to Homebrew for MacOS or e.g.
apt for Ubuntu. To install Chocolatey, run the installation command from their webpage.
@"%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 you can now open Powershell in Administrator mode (Right click -> Run as Administrator). Me woudn’t be me if I didn’t prepare a powershell script with all my desired software listed out so I could easily install it.
To get an easy overview of which software is available you can browse the packages on Chocolatey packages.
Below I took an extract of my personal script to give you an idea on how I get my Windows freshly installed within 45 minutes without to 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 postman
And the list goes on and on in my case. To get all my favorite developer tooling in place.
By Intention I first install
vscode, so I can already start cloning my repos and run my bash scripts (in git Bash) like the one below that installs my vscode extensions.
Now you have installed your desired software using Chocolatey you can keep your software updated using the following commands in Powershell.
cup all -y
cup docker slack -y
In case you ever want to uninstall a piece of software you can allows get a list of installed software and run the uninstall command.
choco uninstall -y virtualbox
Unfortunatily I didn’t went over the hassle of trying to get Wifi working on my Win PE image. I figured that would involve a bit more work which I didn’t want to spent effort on as I have access to cable anyhow. Looking forward to your tips and tricks in the comments.