locked
Pausing the SCCM OSD task sequence RRS feed

Answers

  • I was looking for a method to pause the Task Sequence so I could observe the next step, without sitting at the machine watching for 30 minutes or whatever.

    The easiest method I came up with was a Run Command Line with this command:

    cmd /c start "cmd" /wait cmd

    This launches a command prompt you can see and interact with and the TS waits until the cmd window is closed. This works in WinPE at least, not sure if it works after the OS has been deployed, need to test that, but if it doesn't, you can use a package with a vbscript and then call it in a Run Command Line like this:

    Option Explicit

    Dim WshShell, objShell

    'Create objects
    set objShell = CreateObject("Wscript.Shell")

    'Run(command, window visibility, wait)
    call objShell.Run("cmd.exe /k date /t & time /t", 1, True)

    The vbscript will launch a command window and wait till it is closed, thus pausing your TS.

    • Proposed as answer by scerazy Wednesday, April 27, 2016 7:14 AM
    • Marked as answer by Garth JonesMVP Saturday, July 23, 2016 2:33 PM
    Wednesday, June 20, 2012 11:46 PM

All replies

  • Chirag,

    Just create a script that has something similar to the following:

    wscript.sleep 10000

    This line will pause for 10,000 milliseconds, or 10 seconds.

    Trevor Sullivan
    Systems Engineer
    OfficeMax Corporation
    Tuesday, September 30, 2008 6:15 PM
  •  

    Thanks Trevor.

    My problem shall get solved, if you have an example of pausing the SCCM task sequence till the user types in Ctrl+C or exit or likes?

    Also, how its to be executed? For e.g. putting it in a .vbs and running it through Run Command Line action of SCCM task sequence.

     

    Regards, Chirag

    Tuesday, September 30, 2008 7:03 PM
  • I use the following script, and when I want to continue, I press F8, get a command prompt and echo . > x:\go.txt

     

    Set fso = CreateObject("Scripting.FileSystemObject")
    filespec = "X:\go.txt"

    'Check every 1 second to see if the file exists
    While Not fso.FileExists(filespec)
     Wscript.Sleep 1000
    Wend

    'When it does exist, delete it and go on
    fso.DeleteFile(filespec)

     

     

    Tuesday, September 30, 2008 8:54 PM
  • Query, will this pause work even when the task sequence is running under OS (like Windows 2008) environment instead of winPE environment. We have a real world scenario and hence we need to Pause in both Windows 2008 and winPE. Any thoughts or suggestions?

     

    Regards, Chirag

    Tuesday, September 30, 2008 9:55 PM
  • yes it will, but my sample looks for X:\go.txt, and you don't normally have X: while in Windows... you might want to change to systemdrive environment variable instead... (or similar)

    Tuesday, September 30, 2008 10:40 PM
  • I was looking for a method to pause the Task Sequence so I could observe the next step, without sitting at the machine watching for 30 minutes or whatever.

    The easiest method I came up with was a Run Command Line with this command:

    cmd /c start "cmd" /wait cmd

    This launches a command prompt you can see and interact with and the TS waits until the cmd window is closed. This works in WinPE at least, not sure if it works after the OS has been deployed, need to test that, but if it doesn't, you can use a package with a vbscript and then call it in a Run Command Line like this:

    Option Explicit

    Dim WshShell, objShell

    'Create objects
    set objShell = CreateObject("Wscript.Shell")

    'Run(command, window visibility, wait)
    call objShell.Run("cmd.exe /k date /t & time /t", 1, True)

    The vbscript will launch a command window and wait till it is closed, thus pausing your TS.

    • Proposed as answer by scerazy Wednesday, April 27, 2016 7:14 AM
    • Marked as answer by Garth JonesMVP Saturday, July 23, 2016 2:33 PM
    Wednesday, June 20, 2012 11:46 PM
  • There is a trick to using hta for user interaction in a task sequence. http://blogs.technet.com/b/cameronk/archive/2011/01/25/can-i-use-serviceui-exe-to-launch-other-programs-besides-the-udi-setup-wizard.aspx

    I use this for deploying apps that require user interaction - this allows the user to postpone the installation. In your case you could set a timer in the hta script or just a button to click on to continue the next step on the ts. The task sequence moves onto the next step once it recieves and exit code from uiservice.exe which is closed one the hta script ends or quits.

    Friday, June 22, 2012 2:26 PM
  • You can run a simple one-line vbscript:

    MsgBox ("Pause")

    Friday, June 22, 2012 10:44 PM
  • Wednesday, August 14, 2013 10:02 PM
  • What also works is a run command line step

    C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -command "Start-Sleep -s 60"

    (1 minute)

    Tuesday, September 3, 2013 12:30 AM
  • You can also use a command line with following command : timeout /t 60


    • Edited by _JeB_ Friday, May 16, 2014 6:53 AM
    Friday, May 16, 2014 6:18 AM
  • This is my favorite solution. Thanks much.

    Gary Knigge

    Friday, April 1, 2016 6:22 PM
  • I did not find this to work. It just went on right away. The powershell command above did work for me.

    Gary Knigge

    Friday, April 1, 2016 6:23 PM