Deployment Artist


The site is finally put to rest...

You find new content on the Deployment Research site, a site filled with articles and video-tutorials on how to deploy operating systems. If you are missing something on the new site, please let me know. You can find me on twitter on my @jarwidmark alias.

You can also search the old article archive below.

Regards / Johan Arwidmark

 Blog_List Minimize

 Blog_Archive Minimize

 New_Blog Minimize
You must be logged in and have permission to create or edit a blog.

 BDD Extension: ZTERemoveCompression (boot mgr compressed Fix) Minimize
Location: BlogsJason Scheffelmaer    
Posted by: Jason Scheffelmaer 4/3/2007 7:12 AM

To add the ZTERemoveCompression.wsf script to your scripts folder as an accessible script


Copy & Paste the code below the --Code Snippet-- below in this article into a blank text file and save it as ZTERemoveCompression.wsf.


Copy or Move the ZTERemoveCompression.wsf script to your scripts folder under your distribution share.

(Ex: \\server1\distribution$\scripts\ZTERemoveCompression.wsf)

To add the ZTERemoveCompression.wsf script as a task to the task sequence of a build


Start Deployment Workbench.


In the console tree, navigate to Builds.


In the details pane, right-click build (where build is the build whose task sequence you want to modify), and then click Properties.


Click the Task Sequence tab, navigate to Non-OSD Refresh Onlye group, click Add, and then click Task.

Note   Ensure that you add the task prior to the Apply Windows PE task so that the drive compression is removed before winpe gets applied locally.


Complete the Properties tab of the new task by using the information in the table below, accepting default values if not otherwise specified, and then click Apply.

Completing the Properties Tab of the New Task

In this box Do this


Type Remove C Drive Compression.


Type description (where description is text that explains why the file is needed).

Command line

Type Cscript.exe “%SCRIPTROOT%\ZTERemoveCompression.wsf”.


Complete the Options tab of the new task by using the information in the table below, accepting default values if not otherwise specified, and then click OK.

Completing the Options Tab of the New Task

In this box Do this

Success codes

Type 0. (The ZTERemoveCompression.wsf script returns these codes upon successful completion.)

Conditions list box

Add any conditions that might be necessary .

Upon completion of adding the task to run the ZTERemoveCompression.wsf script, the C: drive will now have its compression removed beforeWinPE gets applied in a refresh scenario.

--Code Snippet--

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

' //***************************************************************************
' // ***** Script Header *****
' //
' // Solution:  Solution Accelerator MOD for Business Desktop Deployment
' // File:      ZTERemoveCompression.wsf
' //
' // Purpose:   To remove the compression from the system drive before applying WinPE.
' //
' // Usage:     cscript ZTERemoveCompression.wsf [/debug:true]
' //
' // Customer Script Version:     1.0.0
' //
' // Extension History:
' // 1.0.0    JOS  4/03/2007  Created initial version.
' //
' // Customer History:
' //
' // ***** End Header *****
' //***************************************************************************

'//  Global constant and variable declarations

Option Explicit

Dim iRetVal

'//  End declarations

'//  Main routine

On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0

'//  Function: ZTIProcess()
'//  Input: None
'//  Return: Success - 0
'//  Failure - non-zero
'//  Purpose: Perform main ZTI processing
Function ZTIProcess()

 iRetVal = Success

 Dim sCmd, objExec, sCheckCompressOut, sUnCompressOut, sCheckOutString, sUnOutString, bFoundSuccess, bFoundCompress

 bFoundSuccess = False
 bFoundCompress = False

 oLogging.CreateEntry "Checking to see if the C drive is compressed.", LogTypeInfo
 sCmd = "compact c:"
 Set objExec = oShell.Exec(sCmd)
 sCheckCompressOut = Split(objExec.StdOut.ReadAll, vbNewLine)
 ' Loop through all output returned and find if a string states that files will be compressed.
 For Each sCheckOutString In sCheckCompressOut
   If InStr(sCheckOutString, "will be compressed") > 0 Then
       oLogging.CreateEntry "Compression is enabled on the C: drive, attempting to remove compression.", LogTypeInfo
       sCmd = "compact c: /u"
       Set objExec = oShell.Exec(sCmd)
       iRetVal = objExec.ExitCode
       sUnCompressOut = Split(objExec.StdOut.ReadAll, vbNewLine)
       For each sUnOutString in sUnCompressOut
           If InStr(sUnOutString, "C:\ not to compress new files [OK]") > 0 Then
        oLogging.CreateEntry "Compression successfully removed from C drive.", LogTypeInfo
        bFoundSuccess = True
        Exit For
    End If
       bFoundCompress = True
       Exit For
   End If

 If bFoundCompress = True Then
     If bFoundSuccess = False Then
          oLogging.CreateEntry "Unable to determine if compression was successfully removed from C drive. Exit Code:" & iRetVal, LogTypeInfo
         End If
      oLogging.CreateEntry "No compression found on drive C, did not attempt to remove.", LogTypeInfo
 End If

 ZTIProcess = iRetVal

End Function



Permalink |  Trackback

Your name:
Add Comment   Cancel 

 Search_Blog Minimize

Copyright 2006-2012 (c)   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2017 by DotNetNuke Corporation