Hiding (and showing) the task sequence progress dialog box


fThe task sequencer used in MDT 2010 and ConfigMgr 2007 is designed to show you at all times what’s going on with your task sequence:

image

As a result, it forces this dialog to be on the top of all other windows, which can be annoying in some situations because you want to get this out of the way.  I’ve seen various solutions for this, typically that just move the dialog out of the way (to the edge of the screen, off the screen, etc.).  But there’s a much easier way to do this:  you can just tell this dialog to close itself using a very simple script:

‘ Hide the progress dialog

Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI")
oTSProgressUI.CloseProgressDialog
Set oTSProgressUI = Nothing

That causes the progress dialog to close (not surprisingly) – at least until it is told to update the progress, something that would typically happen at the start of the next step.  So it’s only gone temporarily, but that’s OK – in most cases, you just want it to be gone for one step anyway, so have that step run a VBScript that hides the dialog, does its work, and then exits.

If you did want the progress dialog to show up again before the next step, you can force a progress update.  If you are referencing the MDT ZTIUtility.vbs script, this is pretty simple too because it already has a function to do this.  Just include logic like this:

‘ Report progress to get the dialog to show up again

oLogging.ReportProgress "Done", 100

If you aren’t using ZTIUtility.vbs, you can add some logic like this:

Public Function OpenProgressDialog

    Dim oProgress
    Dim uStep
    Dim uMaxStep

    ‘ Try to create the progress UI object

    On Error Resume Next
    Set oProgress = CreateObject("Microsoft.SMS.TSProgressUI")
    If Err then
        Err.Clear
        Exit Function
    End if
    On Error Goto 0

    ‘ Update the progress

    On Error Resume Next

    uStep = CLng(oEnvironment.Item("_SMSTSNextInstructionPointer"))
    uMaxStep = CLng(oEnvironment.Item("_SMSTSInstructionTableSize"))
    Call oProgress.ShowTSProgress(oEnvironment.Item("_SMSTSOrgName"), oEnvironment.Item("_SMSTSPackageName"), oEnvironment.Item("_SMSTSCustomProgressDialogMessage"), oEnvironment.Item("_SMSTSCurrentActionName"), (uStep), (uMaxStep))

    On Error Goto 0

    ‘ Dispose of the object

    Set oProgress = Nothing

End Function

If using ZTIUtility, the complete script could look like this:

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

    ‘ Hide the progress dialog

    Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI")
    oTSProgressUI.CloseProgressDialog
    Set oTSProgressUI = Nothing

    ‘ <Do your work here>

    ‘ Show the progress dialog (using one of these methods) if you don’t want to wait

    oLogging.ReportProgress "Done", 100

    ‘ <Maybe do some more work>

   </script>
</job>

If you aren’t using ZTIUtility.vbs, it gets a little longer:

<job id="Scripting201">
   <script language="VBScript">

    ‘ Hide the progress dialog

    Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI")
    oTSProgressUI.CloseProgressDialog
    Set oTSProgressUI = Nothing

    ‘ <Do your work here>

    ‘ Show the progress dialog (using one of these methods) if you don’t want to wait

    OpenProgressDialog

    ‘ <Maybe do some more work>

    ‘ The OpenProgress Dialog method gets the dialog to show up again

    Public Function OpenProgressDialog

        Dim oProgress
        Dim uStep
        Dim uMaxStep

        ‘ Try to create the progress UI object

        On Error Resume Next
        Set oProgress = CreateObject("Microsoft.SMS.TSProgressUI")
        If Err then
            Err.Clear
            Exit Function
        End if
        On Error Goto 0

        ‘ Update the progress

        On Error Resume Next

        uStep = CLng(oEnvironment.Item("_SMSTSNextInstructionPointer"))
        uMaxStep = CLng(oEnvironment.Item("_SMSTSInstructionTableSize"))
        Call oProgress.ShowTSProgress(oEnvironment.Item("_SMSTSOrgName"), oEnvironment.Item("_SMSTSPackageName"), oEnvironment.Item("_SMSTSCustomProgressDialogMessage"), oEnvironment.Item("_SMSTSCurrentActionName"), (uStep), (uMaxStep))

        On Error Goto 0

        ‘ Dispose of the object

        Set oProgress = Nothing

    End Function

   </script>
</job>


Comments (8)
  1. Anonymous says:

    There could be complications with a 64-bit boot image.  In that case, you need to run a 64-bit CSCRIPT process to access the 64-bit Microsoft.SMS.TSProgressUI component.

    -Michael

    1. Simon Olsen says:

      Thanks for this, Mike. It looks realy good.
      Could you elaborate on how to run the 64-bit version of cscript.exe? I am using the 64-bit boot image from ADK for Win10 (10.0.10240.16384).
      Also, what would be REALLY cool is some kind of description of the TSProgressUI Object and its properties and methods 😉
      Thanks Again!

  2. Eric says:

    I am using this in an MDT task sequence.  It works fine in a 32 bit OS, but it does not work for me in a 64 bit OS. I realize there are different files for the different architectures.  any reason why this won't work under 64 bit?

  3. Stefan says:

    Hi Michael,

    sorry for stupid asking, but how have I to implement the script? As example I want to install some software with AutoIT with sends keystrokes. But if the progressbar is always in front of the software which is installing the keystrokes are send to the progressbar. Do I have to call the script in task sequence or bevor running software installation? Thank you very much

    Stefan

  4. Jerry Rice says:

    where can I put this?

       ' Hide the progress dialog

       Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI")

       oTSProgressUI.CloseProgressDialog

       Set oTSProgressUI = Nothing

  5. Kazzan says:

    Is there a SCCM way to show this progress bar in TS which run in logged out computers?

  6. showbox says:

    Thanks for the great info. I really loved this. I would like to apprentice at the same time as you amend your web site, how could i subscribe for a blog site?
    For more info on showbox please refer below sites:
    http://showboxandroids.com/showbox-apk/
    http://showboxappandroid.com/
    Latest version of Showbox App download for all android smart phones and tablets.
    http://movieboxappdownloads.com/ – It’s just 2 MB file you can easily get it on your android device without much trouble. Showbox app was well designed application for android to watch movies and TV shows, Cartoons and many more such things on your smartphone.
    For showbox on iOS (iPhone/iPad), please read below articles:
    http://showboxappk.com/showbox-for-ipad-download/
    http://showboxappk.com/showbox-for-iphone/
    Showbox for PC articles:
    http://showboxandroids.com/showbox-for-pc/
    http://showboxappandroid.com/showbox-for-pc-download/
    http://showboxforpcs.com/
    There are countless for PC clients as it is essentially easy to understand, simple to introduce, gives continuous administration, effectively reasonable. it is accessible at completely free of expense i.e., there will be no establishment charges and after establishment
    it doesn’t charge cash for watching films and recordings. Not simply watching, it likewise offers alternative to download recordings and motion pictures. The accompanying are the strides that are to be taken after to introduce Showbox application on Android.
    The above all else thing to be done is, go to the Security Settings on your Android telephone, Scroll down and tap on ‘Obscure sources’.

  7. aw says:

    hai, I just want to tell you that I am just very new to blogs and seriously loved this website. More than likely I’m planning to bookmark your blog post .
    You amazingly come with really good posts. Thanks a lot for sharing your blog Microsoft.

    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Aceh
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Bali
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Balikpapan
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Bandung
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Banjarmasin
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Banten
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Batam
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Bekasi
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Bengkulu
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Bogor
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Bontang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Cianjur
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Cikarang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Cilegon
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Cirebon
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Denpasar
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Jakarta
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Jambi
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Jember
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Karawang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Kendal
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Kudus
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Kupang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Lampung
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Madiun
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Makasar
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Malang
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Maluku
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Manado
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Medan
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20NTT
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Padang

Comments are closed.