Tuesday, July 5, 2011

Blog Post: Register system variable in MDT - Script

It’s possible to write a task sequence variable but not the Windows Environment Variables. But you can write a simple wsf file and use the in-built registry write function.

<job id=" Z_Filename.wsf ">

<script language="VBScript" src="ZTIUtility.vbs"/>

<script language="VBScript">

oShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\MDTPath", oEnvironment.Item("DeployRoot"), "REG_SZ"

oLogging.CreateEntry "Registry Value Successful.", LogTypeInfo

</script>

</job>

Save the file Z_Filename.wsf to scripts folder

From the task sequence, just create a step run command cscript.exe "%SCRIPTROOT%\Z_Filename.wsf"

clip_image001

clip_image003

Above script creates an system varialble called MDTPath and set the value to the oEnvironment.Item("DeployRoot") which would be \\servername\sharename$ in this case.

 

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use.

IRON MOUNTAIN INORATED IOMEGA INTUIT INTERSECTIONS INTERNATIONAL RECTIFIER

No comments:

Post a Comment