5 Replies Latest reply: Apr 12, 2012 7:38 AM by rayjen0919 RSS

    SD - Batch Cmd Succeed deployed but result show failed (Code:16386)

    rayjen0919 Apprentice

      Dear All,

       

      Since I've created a batch file with below command:

       

      @echo off
      cls
      echo Set Default Printer

      pushd %~dp0
      rundll32 printui.dll,PrintUIEntry /y /q /n "FX ApeosPort-III C5500 PCL 6"

       

      The process result with error code 16386 but the specific printer is set to default successfully!

      How to make it be "Succeed" Result???

       

      sd_result.jpg

       

      Please adivse, thanks!

      RAY CHAN

       

      Core: LDMS9.0 SP2 SD MSD PATCH 2011-0428 in Windows Server 2003 R2

        • 1. Re: SD - Batch Cmd Succeed deployed but result show failed (Code:16386)
          mrspike SSMMVPGroup

          You should read the guide at

           

          http://community.landesk.com/support/docs/DOC-2320

           

           

          The first thing I see is you are using @ECHO OFF

           

           

          In order for LANDesk to "read" the batch file better, use @ECHO ON

           

          LANDesk will supress it from the user, it will then be able to collect the data / output better.

           

           

          That might do it, but you might have to put in some exit code info as shown in the guide

          • 2. Re: SD - Batch Cmd Succeed deployed but result show failed (Code:16386)
            rayjen0919 Apprentice

            Dear James,

             

            Sorry, I'm not really understand, am I change the script as below:

             

            @Echo ON
            cls
            Echo Set Default Printer To Pantry Printer
            rundll32 printui.dll,PrintUIEntry /y /q /n "FX ApeosPort-III C5500 PCL 6_Pentry"
            :end

             

            ???

            Pls advise, thanks!

             

            Ray

            • 3. Re: SD - Batch Cmd Succeed deployed but result show failed (Code:16386)
              ahe Expert

              Hello,

               

              you need a true exit code to get a successful...

               

              At first you have to check, if the line send a return code and which codes...

               

              rundll32 printui.dll,PrintUIEntry /y /q /n "FX ApeosPort-III C5500 PCL 6"
              

               

               

              In dependency of the return code you can change the exit codes, you can send to LANDesk, for example something like this:

              IF “%ERRORLEVEL%”==”1001” EXIT /B 0

               

              Take a look in the doc James' posted at page 20ff...

               

               

               

              Regards

              Axel

              • 4. Re: SD - Batch Cmd Succeed deployed but result show failed (Code:16386)
                Apprentice

                So you have hit the 16386 error with batch deployments you too.

                I see that it is suggested that you do a "real exit 0" by mapping %errorlevel% to Exit /B 0

                My experience with this errorcode is that it does not help.

                 

                Check your client log files, look for sdistbat.log in LDCLIENT folder

                When I get the 16386 code, my log file looks like this:

                --- start --

                Tue, 06 Mar 2012 14:38:47 Started command prompt for processing batch file (process id 3784)

                Tue, 06 Mar 2012 14:38:47 Batch file process has exited.

                Tue, 06 Mar 2012 14:40:47 Waiting for the batch file event returned 258

                Tue, 06 Mar 2012 14:40:47 Batch file status of -1918091262 obtained from shared memory
                --- end ---
                When I successfully deploys a bath file it looks like this:

                --- start ---

                Tue, 06 Mar 2012 14:32:37 3932  980 Started command prompt for processing batchfile (process id 3868)

                Tue, 06 Mar 2012 14:32:52 2916 2900 Setting status for batch file to 0 using event SetBatchFileStatusEvent

                Tue, 06 Mar 2012 14:32:52 3932  980 Batch file process has exited.

                Tue, 06 Mar 2012 14:32:52 3932  980 Waiting for the batch file event returned 0

                Tue, 06 Mar 2012 14:32:52 3932  980 Batch file status of 0 obtained from sharedmemory
                Tue, 06 Mar 2012 14:32:52 3932  980 treating status as win32 HRESULT, updated value 0x00000000
                --- end ---

                Look at the bold lines, see how they differ. What the "batch file event returned 258" means? I dont know. Maybe LANDesk knows?

                This I have seen on a lot of clients with LD90 SP2 with the latest MCPs.

                 

                My solution, upgrade the agent to LD90 SP3  => no more problems with batch deployments and the 16386 code.


                • 5. Re: SD - Batch Cmd Succeed deployed but result show failed (Code:16386)
                  rayjen0919 Apprentice

                  Dear Bjorn,

                   

                  Obviously, I need to upgrade to SP3 so that the problem can be solved.

                  Billion thanks!!!

                   

                  Ray