4 Replies Latest reply on Mar 6, 2012 3:32 PM by jslee102

    Job status issue..

    jslee102 Rookie

      Hi all,

        I'm having a problem with a job that I'm trying to create for the Cisco Anyconnect client.  It would appear that since I'm replacing the wireless supplicant that I'm dropping my wireless connection which is then causing a 187 "The network cannot be reached from the host at this time.

       

        Is there some way that I can get the machine to report back status after the reboot?  It is a series of .msi files that need to be installed.  I've created a batch file to run through them, then reboot.  I got the impression from a document that I should be able to do a reboot, then finish the batch file which would show the udpated status, but I'm apparently clueless on how to make this work.

       

        Thanks for any help.

       

      John Lee

        • 1. Re: Job status issue..
          mrspike SSMMVPGroup

          This is the template I use, I found on the community here sometime ago and it works... you can add "sections" or remove them as needed

           

           

           

          @ECHO ON
              if "%1" == "" goto section1
              if "%1" == "section2" goto section2
              if "%1" == "section3" goto section3
              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

          • 2. Re: Job status issue..
            mrspike SSMMVPGroup

            If you only have a 1 part task, but a reboot is needed, this works

             

             

             

            @ECHO ON
            if "%1" == "" goto section1
            if "%1" == "alldone" goto alldone


            :section1
            ::REM Do work here


            REM Call for reboot
            sdclient.exe /msg="Reboot needed"
            sdclient.exe /onreboot /bat /p=%0 /cmds=alldone
            sdclient.exe /reboot
            goto getout


            :alldone
            set errorlevel=0
            sdclient.exe /msg="reboot and task completed"


            :getout

            • 3. Re: Job status issue..
              mrspike SSMMVPGroup

              I have been finishing up a task that will use this type of .bat file that will be a Policy job in the Portal and it kept failing to run after the reboot...

               

              I found that the file was trying run from the last folder that was called in the .bat file and it is not there, it is in the sdmcache\xxx\xxx folder...

               

              I found a work around for that if you run into this issue...

               

               

              example:

               

              You call a .bat file named 'widget.bat', it copies some files to %WINDIR%\TEMP\widgetapp\

               

              That bat file has command that change directories, such as:

              CD %WINDIR%\TEMP\widgetapp

               

              At then end of the first 'section' of the .bat file, if you just call the sdclient.exe /reboot and such commands, when the system reboots it will try to run your widget.bat from %WINDIR%\TEMP\widgetapp and fail, as it is in the

               

              "%ProgramFiles%\LANDesk\LDClient\sdmcache\myshare\mysubfolder\widgetapp\" folder.

               

              So to get around it, as the last command in Section 1 (and other sections of the batch file as needed) and BEFORE the sdcelient/exe commands, call this:

               

              CD "%ProgramFiles%\LANDesk\LDClient\sdmcache\myshare\mysubfolder\widgetapp\"

               

               

              Now after the reboot when it goes to run widget.bat, it will find and run it from the above directory

              • 4. Re: Job status issue..
                jslee102 Rookie

                Thanks!!!