Deployment Artist
   Minimize

 

The deployvista.com 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 deployvista.com article archive below.

Regards / Johan Arwidmark


 Print   
 Blog_List Minimize

 Print   
 Blog_Archive Minimize

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

 Print   
 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

1.

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

2.

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

1.

Start Deployment Workbench.

2.

In the console tree, navigate to Builds.

3.

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

4.

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.

5.

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

Name

Type Remove C Drive Compression.

Description

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

Command line

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

6.

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
       Next
      
       bFoundCompress = True
       Exit For
  
   End If
 Next


 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
 Else
      oLogging.CreateEntry "No compression found on drive C, did not attempt to remove.", LogTypeInfo
 End If


 ZTIProcess = iRetVal

End Function


   </script>
</job>

  

Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search_Blog Minimize

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