At work, I’m in a situation where we have over 1,000 computers to manage. Over the years, we’ve gone through several different versions of a base image of Windows XP created with Sysprep which we put on all of the new computers that come in. When we’re out in the field troubleshooting a problem on a computer, it’s nice to know which image was used on that computer. Previously, I was having to open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\Setup\OemDuplicatorString. This got old real fast, so I wrote a quick VBScript to display it:
Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "SYSTEM\Setup" strValueName = "OEMDuplicatorString" objRegistry.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrValues If IsNull(arrValues) Then Wscript.Echo "This computer has no Sysprep identification string." Else Wscript.Echo "This computer's Sysprep identification string is:" & VbCr & VbCr & arrValues(0) End If
Simply save that code as “Display Sysprep Identification String.vbs”! For an extremely detailed guide on how to use Sysprep, I recommend this one.