Currently I am creating a Windows PE image in order to perform some common tasks outside of the actual operating system (as a recovery disk). A few of the tasks that this image will be able to perform will include a registry recovery (from an initial backup) and multiple check disk functions. During the registry recovery from backup, the Windows 7 product key association in the registry is either invalidated or deleted, and when the computer is booted to the actual OS, Windows asks for the product key to activate itself.
This happens about 90% of the time that I'm recovering the registry, and it isn't a problem to insert the product key after boot, however, it is quite tedious. In order to remedy this, I've been attempting to figure out a way to insert the product key with some command line functions from my WinPE image, utilizing
slmgr /ipk ##-## and
slmgr /ato after Windows 7 starts.
I've been able to write a batch script to (attempt to) import the key and add
slmgr /ato to the registry to run at startup, but I've been unsuccessful in getting
slmgr /ipk ##-## to run in the Windows PE environment. The problem that I'm having is along the lines of this:
Can't find script engine "VBScript" for script "C:\Windows\System32\slmgr.vbs"
I've tried registering the
.dlls associated with
.vbs files (
jscript to my knowledge) in the System32 and SysWOW64 folders. I've tried importing one of the various Windows Vista/7 registry files found around the web that restore the functionality of
.vbs files. I've also tried cscript and wscript, both of which tell me the same error about lacking a scripting engine.
My question is, is there any way to push an activation key onto a Windows 7 drive through a WinPE recovery environment? Is there some additional package that I should be adding to my
.wim to achieve the ability to use
.vbs files, or is there a better way to activate Windows from inside WinPE than using
Thank you for any assistance.