2 Replies Latest reply on Aug 20, 2010 8:18 PM by Dataspike

    The sdclient /reboot command...

    Specialist

      I've created a software distribution that uses the sdclient /reboot option to reboot a machine several times during the entire process, and I'm getting an unexpected result.

       

      If I call a reboot more than once in the batch file, the user has the option to cancel the reboot.  Here's a test batch file to simulate what I am doing. I am using it with a Push delivery method.

       

      if "%1" == "" goto section1
      if "%1" == "section2" goto section2
      if "%1" == "section3" goto alldone
      if "%1" == "alldone" goto alldone


      :section1
      REM ---------------------------------------------
      REM -- do work here that will require a reboot --
      REM ---------------------------------------------
      sdclient.exe /msg="The client has not yet rebooted."
      sdclient.exe /onreboot /bat /p=%0 /cmds=section2
      sdclient.exe /reboot
      goto getout


      :section2
      REM ---------------------------------------------
      REM -- do work here that will require a reboot --
      REM ---------------------------------------------
      sdclient.exe /msg="The client has rebooted once."
      sdclient.exe /onreboot /bat /p=%0 /cmds=section3
      sdclient.exe /reboot
      goto getout


      :section3
      REM ---------------------------------------------
      REM -- do work here that will require a reboot --
      REM ---------------------------------------------
      sdclient.exe /msg="The client has rebooted twice."
      sdclient.exe /onreboot /bat /p=%0 /cmds=alldone
      sdclient.exe /reboot
      goto getout

       

      :alldone
      REM -----------------------------------------
      REM -- Finish up the work after the reboot --
      REM -----------------------------------------
      set errorlevel=0
      sdclient.exe /msg="The client has reboot three times, we are now done."
      :getout


      When the SD Task reaches the first request for a reboot this is shown to the user

      8-20-2010 1-33-40 PM.png

      When the SD Task reaches the second and subsequent requests this is what is shown to the user

      8-20-2010 1-33-50 PM.png

       

      If I press cancel on the second or subsequent requests the CORE thinks the reboot task has been initiated and the system is rebooting, when in fact it's not.  So unless the user reboots, once or multiple times the task will either time out on the core, or never complete.

       

      Am I missing something?  How do I prevent the user from canceling the subsequent reboot requests?

       

      Chris