Home > View Post

The lean, mean, rebuild-ready machine

I like to rebuild my machine pretty frequently. Sometimes it's simply to give me a fresh start and spring clean the system and other times it's because I'm always trying the latest and greatest tools and OS, like Windows 7 Beta for example. Now I'm running 7 beta, I'll likely be rebuilding on an even more frequent basis. Therefore being slick at this process is more important than ever.

In order to facilitate this I follow a few key practices that I thought I'd share with you.

  • 1. Have two drives
    If you're not lucky enough to have two drives (like most laptops) then go for a partition. The first drive is used to store the OS and I format and fry this partition everytime I rebuild. The other drive, therefore, is used for everything I want to keep: user files, data, important downloads, Snippets and zero-footprint tools. My laptop only has one drive that's 160GB in size and I create 70GB partition for the OS and 80GB for User Data (the rest is roughly taken up by Bitlocker and the other usual 'loss'). Another benefit is, if I'm feeling frugal with disk space I only need to backup the User Data drive.

  • 2. Move your 'My Documents' to the User Data drive
    The process for doing this varies by OS (XP, Vista and 7 are all slightly different). In Win 7 you get to use the new libraries feature which is very awesome.

  • 3. Keep a list of software you use
    There are plenty of lists out there detailing all the software various bloggers like to install onto a fresh machine, so I'll spare you mine. Suffice to say, having such a list is a very good idea. I go through Add/Remove programs before wiping the previous OS and double-check that my list is up to date. I can't stress how important this step is. It's easy to skip over but, if you do, I guarantee that you'll forget to install one thing that you'll need at your next presentation. Yes, this has happened to me.

  • 4. Keep your handy tools on the User Data drive
    I have a Tools folder on my user data drive in which I keep all the usual suspects. Things like the SysInternals Suite, Reflector, Debugging tools for Windows, TcpTrace etc. I even install zero/minimal footprint tools like Notepad++ into this folder. I then execute a PowerShell script to add all the .EXEs in this folder to my Start menu. The script is below:

Powershell script to add tools to Start menu

This must be run as administrator.
$tools = dir "U:\Tools\" -Filter "*.exe" -Recurse;
$shell = new-object -com "
WScript.Shell";
$p = $shell.SpecialFolders.Item("
AllUsersPrograms");
$folder = join-path $p "
Tools"
if (-not(test-path $folder)) { new-item $folder -type directory }
$tools | foreach {
    $productName = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).ProductName;
    if ([System.String]::IsNullOrEmpty($productName)) { $productName = $_.Name };
    $lnkName = (join-path $folder $productName) + "
.lnk";
    $lnk = $shell.CreateShortcut($lnkName);
    $lnk.TargetPath = $_.FullName;
    $lnk.Save();
}

Happy rebuilding.

Tags: Powershell

 
Josh Post By Josh Twist
10:07 AM
10 Feb 2009

» Next Post: Sub-selects in code with the Entity Framework
« Previous Post: WPF Snippets for Visual Studio

Comments are closed for this post.

© 2005 - 2017 Josh Twist - All Rights Reserved.