Skip to main content

Command sheet from my teched session

Several people have been asking for my cheat sheet with the commands used during my demonstrations at TechEd. Yes I do cheat, don't want to use time troubleshoot fatfinger problems.

So here are the list, remember that the presentation also includes code pages with more stuff, like lots of wmi entries


DEMO: Refresh Image / WinRE

Show Recimg
Replace refresh image

Refresh Commands:

Recimg /createimage c:\Refresh2

Recimg /showcurrent

Recimg /setcurrent c:\Refresh

WinRE Commands:

Rename c:\winre\boot.wim c:\winre\winre.wim

ReAgentc /info

Reagentc /disable

Reagentc /setreimage c:\WinRE

Reagentc /enable

Reagentc /boottore


DEMO: Patch the image Offline/Online

Demo Commands:


dism /Get-WimInfo /WimFile:d:\wim\install.wim

Extended info:

dism /Get-WimInfo /WimFile:d:\wim\install.wim /index:1

Mounting the image:

dism /Mount-Wim /wimfile:d:\wim\install.wim /index:1 /MountDir:d:\mount

Add Patches to the image:

dism /image:d:\mount /add-package /Packagepath:d:\updates

Dismounting the image:

dism /Unmount-Wim /MountDir:d:\mount /commit

dism /Unmount-Wim /MountDir:d:\mount /discard


DEMO: WMI Filtering

Demo Commands:

Select * from WIN32_ComputerSystem where Manufacturer = 'LENOVO'

Gpresult /Scope:computer


DEMO: Group Policy

Demo Commands:

Tuning old computers

0 = Let Windows choose what's best for my computer
1 = Adjust for best appearance
2 = Adjust for best performance
3 = Custom

Block Access To Store

User/Computer - Policies - Administrative Templates - Windows Components - Store

Create new local admin, rename old and set password

Computer - Preferences - Control Panel settings - Local Users and Groups


bginfo.exe client.bgi /SILENT /TIMER:00  /nolicprompt


Create new folder on desktop, name it GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

Popular posts from this blog

Changing Windows product key (license) for a MDT OS deployment task

Creating a new OS deployment task in MDT you will be asked to specify product key

That’s easy enough, but what if you type in the wrong key or just want to change it (add it) later? You might even have gotten a new MAK.

That is not as easy, you cannot do it from the graphical interface, you have to do it from one of the configuration files. Well you might to it from graphical interface by typing it in every time deploying a computer gets deployed but that is not a great solution.

MDT - The task sequence has been suspended. LiteTouch is trying to install applications

Every now and then I get this error message when fuelling a computer with MDT:
"The task sequence has been suspended. LiteTouch is trying to install applications. This cannot be performed in Windows PE."

How to get and use the Windows key from UEFI/BIOS

I found myself in the situation that I needed to get the Windows key out from the ACPI in the UEFI bios and preferable get to use it in a task sequence in MDT.

There are different ways of doing this, but I wanted to do this with little code and easy to understand.
There is a nice tool created to get the key on github, created by Christian Korneck, called get_win81key. This tool gives you the key in plane text. You can get it

If I were supposed to do this manually, I now would just take that key and type it in with slmgr command or in the GUI. But I want to do this within a task in MDT.
Testing a couple of solutions without using the get_win8key with my great scripting guru colleague HÃ¥vard ( and figuring out that it cannot be done with default powershell stuff, it needs more code. Therefore, we quickly figured out that some use of the “get_win8key” files is the easiest way, but we need a way of setting the output fro…