Skip to content
Go back

Repaving your PC: the easier way

Edit page

It"’s been a while since I had to repave my laptop. I have a Windows Home Server (WHS) at home which images my PC almost daily and allows restoring it to a given point in time in less than 30 minutes. Which is awesome! And which is how I usually “restore” my PC into a stable state.  Over the past year some hardware changes have been made of which the most noteworthy is the replacement of the existing hard drive with an SSD. A great addition, and it was easy to restore as well: swap the disks and restore the image from WHS. SSD and full system install? 30 minutes.

imageThe downside of restoring an image which came from a non-SSD drive has been bugging me for a while though. My SSD did not feel as fast as it should have felt, resulting in me reinstalling Windows on it just to check if that led to any speed improvements. And it did. And I knew I was in trouble: that would be a load of software to re-install and reconfigure. Here’s a list of what I had on my system before and is absolutely required for me to be able to do my job:

Oh boy… Knowing how '”fast” some of these can be installed, that would cost me a day of clicking and waiting.

[edit]Also checkout https://github.com/chocolatey/chocolatey/issues/46[/edit]

Three tools can save you a lot of that work

Fortunately, we live in this time of computers. A time where some things can be automated and it seems like a PC repave should be relatively easy to do. There are three tools that will save you time:

Using these three tools, I have created a script which you have to run in a PowerShell administrative console. The scripts consist of calls to the Web PI, Ninite and Chocolatey. I’ll give you an example:

Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/

—> 1 # Windows Installer 2 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:WindowsInstaller31 3 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:WindowsInstaller45 4 5 # Powershell 6 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:PowerShell 7 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:PowerShell2 8 9 # .NET 10 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:NETFramework20SP2 11 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:NETFramework35 12 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:NETFramework4 13 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:JUNEAUNETFX4 14 15 # Ninite stuff 16 cmd /C ninite\ninite.exe 17 18 # Chocolatey stuff 19 iex ((new-object net.webclient).DownloadString(http://bit.ly/psChocInstall)) 20 21 cinst windowstelnet 22 cinst virtualclonedrive 23 cinst sysinternals 24 cinst notepadplusplus 25 cinst adobereader 26 cinst msysgit 27 cinst fiddler 28 cinst filezilla 29 cinst skype 30 cinst paint.net 31 cinst ccleaner 32 cinst tortoisesvn 33 cinst tortoisehg 34 35 # IIS 36 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:IIS7 37 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:ASPNET 38 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:BasicAuthentication 39 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:DefaultDocument 40 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:DigestAuthentication 41 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:DirectoryBrowse 42 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:HTTPErrors 43 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:HTTPLogging 44 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:HTTPRedirection 45 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:IIS7_ExtensionLessURLs 46 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:IISManagementConsole 47 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:IPSecurity 48 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:ISAPIExtensions 49 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:ISAPIFilters 50 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:LoggingTools 51 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:MetabaseAndIIS6Compatibility 52 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:NETExtensibility 53 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:RequestFiltering 54 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:RequestMonitor 55 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:StaticContent 56 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:StaticContentCompression 57 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:Tracing 58 cmd /C webpicmdline\webpicmdline.exe /AcceptEula /SuppressReboot /Products:WindowsAuthentication

For those interested, here’s the set of scripts I have used: Repave.zip (986.66 kb). These contain a number of commands that use the tools mentioned above to do 75% of the install work on my PC. All I had to do was install Office 2010, VS2010 and my scripts did the rest. Not the holy grail yet, but certainly a big relief of a lot of frustration finding software and clicking next-next-finish. And now my PC has been repaved, it’s time for a WHS image again. Enjoy!


Edit page
Share this post on:

Previous Post
Techniques for real-time client-server communication on the web (SignalR to the rescue)
Next Post
Publishing symbol packages for a MyGet feed