Registry setting not applied during deployment

by Mitch Tulloch [Published on 4 April 2012 / Last Updated on 4 Aug. 2011]

This tip provides updated info concerning an earlier tip about a registry setting not being applied during deployment when a task sequence runs in MDT 2010.

Problem: You are using the 32-bit version of MDT 2010 to deploy a 64-bit edition of Windows 7 to a target computer. Near the end of your task sequence you've added a step that runs a reg.exe command to change a registry setting on the deployed installation of Windows. When you log on to the deployed installation, you find that the registry setting was not applied. You check all the MDT and Windows log files and you find nothing to indicate why this may have happened. What do you do?

Resolution: Modify the task sequence step to change the path for the command from C:\Windows\System32\reg.exe to C:\Windows\Sysnative\reg.exe and perform your deployment again and it should work properly now. The reason it didn't work before is because of the file system redirection feature of 64-bit Windows 7. On Windows 7 x64 the %WinDir%\System32 folder contains the native 64-bit versions of system executables and DLLs while the %windir%\SysWOW64 folder contains the corresponding 32-bit versions of these applications. Because of file system redirection, whenever a 32-bit application tries to access a 64-bit application like reg.exe C:\Windows\System32 on a 64-bit Windows installation, the request gets automatically redirected to the 32-bit version of reg.exe found at %windir%\SysWOW64\reg.exe. By incorporating the special alias \Sysnative in the path you specify for the application, redirection is overridden and you force the native 64-bit version of the application to be executed. For more information see the following article in the MSDN Library: http://msdn.microsoft.com/en-us/library/aa384187(VS.85).aspx

Updated info: This problem is not just associated with MDT deployments—it also applies to OSD (Operating System Deployment) task sequences in Microsoft System Center Configuration Manager.  This is because an OSD task sequence runs as a 32—bit process even when it is applying a 64-bit operating system, and since your VBscript is also running within the OSD tasks sequence it too will be launched using C:\windows\syswow64\cscript.exe.  Thanks to Keith Garner of Xtreme Consulting Group for alerting me to this issue.

Mitch Tulloch is a seven-time recipient of the Microsoft Most Valuable Professional (MVP) award and widely recognized expert on Windows administration, deployment and virtualization. For more tips by Mitch you can follow him on Twitter or friend him on Facebook.

 

Featured Links