8 Replies Latest reply on Apr 4, 2008 9:29 AM by Luc.Levesque

    Need help with custom script.

    Rookie

       

      There must be a simple way...

       

       

      I want to schedule a Dos HDD utils. It has to run under DosPE.  

       

       

      I'm not familiar with the  management scripting, but from the little info I have, here is my script. It is failing right at the shutdown command.

       

       

      Any pointers in the right direction would be greatly appreciated. Or documentation on the scripting language would be nice.

       

       

      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      ;

      ;  LANDesk(R) Management Suite Custom Script

      ;  Spinrite HDD Level 2 scan and reboot

      ;

      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

       

      ABORT_ON_CMD_FAILURE=1

      TASK_COMPLETION_ENABLED=FALSE

       

       

       

      REMEXEC1=<qt/>%systemroot%\system32\shutdown.exe</qt> -t 30 -f -r -c "Préparation pour un diagnotique SpinRite" STATUS

      BEGINDOS=TRUE

      REMPING2=DOS

      REMEXEC3=htget -o spinrite.exe http://csdc-landesk/landesk/files/spinrite.exe

      REMEXEC4="command.com /c h:\spinrite.exe auto exit drive 0 level 2", STATUS FACILITY=3513

      REMEXEC5=reboot

       

       

        • 1. Re: Need help with custom script.
          zman Master

          I could be wrong (my DOS stuff is a little old), but I don't think that %systemroot% variable is in DOS. Try a hard coded path. Also, look at using the ""  tag when you post code syntax in the message. Makes it easier to read.

          1 of 1 people found this helpful
          • 2. Re: Need help with custom script.
            Rookie

             

            %systemroot% returns c:\windows on my windows xp machine.

             

             

            Hardcode the path and it worked like a charm. Thanks...

             

             

            Now the dospe part... It completly ignored the BEGINDOS=True 

             

             

             

             

             

            I'm not sure how to get it to autoselect the DOSPE option in the pxe menu. I copied from the other landesk dospe scripts but don't quite understands how it tells the pxe rep or client to pick Dospe Managed. It always choose localboot.

             

             

            Code! Got it.. Thanks .. fist time user   

             

             

             

             

             

            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            ;
            ;  LANDesk(R) Management Suite Custom Script
            ;  Spinrite HDD Level 2 scan and reboot
            ;
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
            [JOBPARAM]
            ABORT_ON_CMD_FAILURE=1
            TASK_COMPLETION_ENABLED=FALSE
            
            
            [PREMACHINE]
            
            [MACHINES]
            REMEXEC1=c:\windows\system32\shutdown.exe -t 30 -f -r -c "Preparation pour un diagnotique SpinRite"
            BEGINDOSPE=TRUE
            REMPING2=DOS
            REMEXEC3=htget -o spinrite.exe http://csdc-landesk/landesk/files/spinrite.exe
            REMEXEC4="command.com /c spinrite.exe auto exit drive 0 level 2", STATUS FACILITY=3513
            REMEXEC5=reboot
            

             

             

             

            • 3. Re: Need help with custom script.
              zman Master

               

              OK not really sure what you are doing with spinrite, but this may make it a little easier:

               

              1. Open OSD

              2. Right Click on ALL OSD / Profile ......

              3. Select New DOS generic Script

              4. Fill in the blanks.

              5. Enter all your commands - You don't need the reboot or other stuff just the htget and what you want to execute. - Spinrite. I don't think you need to call command.com either.

              6. For htget call it from r:\net\htget

              7. Save it and Schedule it.

              See if this works, as I said I have not dabbled in DOS for a while.

              • 4. Re: Need help with custom script.
                Apprentice

                 

                A few things to note:

                 

                 

                 

                 

                 

                htget will take the file you are trying to access and pull it into the RAMDRIVE created by the DOS boot image.  The drive is limited in size, so be mindful of that.   Next, you need to go to the path (R:\) in order to run spinrite in your remexec.

                 

                 

                I've found it easier to do what the OSD tasks do for imaging: Map a share to a distribution point that is accessible from dos and run the utility from the shared drive.

                 

                 

                • 5. Re: Need help with custom script.
                  phoffmann SupportEmployee

                  You say you boot into WinPE - I take it that you schedule this to your clients while they're logged into Windows then (and the devices Virtually boot into PE).

                   

                  One thing that you may have missed here is setting your "default" PE environment - if you need it to be DOS, then you might have to set it to be DOS (as opposed to WinPE).

                   

                  You do that this way:

                  1. Open the 32-bit Console.

                  2. Open the "Operating System Deployment" tool.

                  3. Click on the "Validate Licenses" button - that's the third icon from the left, above the OSD scripts.

                  4. In there, you'll see (at the bottom 3rd of the little screen) the section "Default preboot environment". You may want to set yourself to DOS.

                   

                  Since you may have it set to WinPE, any script you create will - by default - load the WinPE image, so the "BEGINDOS" section will not make any sense to custjob. It will only make sense when the client actually is IN DOS, as opposed to WinPE (I hope this makes sense).

                   

                  So - set the default mode to DOS, and then create a new script - and this time it will copy down the LDVBOOT.IMG as opposed to the WinPE image :).

                   

                  Paul Hoffmann

                  LANDesk EMEA Technical Lead.

                  • 6. Re: Need help with custom script.
                    Rookie

                     

                    Everyone's answers are valid. Thanks much

                     

                     

                    Zman, the instruction you gave me are the closest I've got yet.  Now the client loads the ldvboot.img but jams at the landesk splash screen. Take note that the client pc that I'm testing with is a VM. Any pointer? How can I get rid of the splash screen so I can look at the dos commands.

                     

                     

                     

                     

                     

                    Why Spinrite? We are an IT staff of 2 and our territory covers 400KM in both direction. We have found that it was easier to run a spinrite on a machine with HDD problems than driving there, rip the HD out, ship it, wait for the new one, drive back to install the HD.  If you don't know about Spinrite, check out www.grc.com/spinrit. Right now to run Spinrite we have to rely on someone from the school and guide them by phone. I want to schedule a preventive Spinrite every few month. Really... I'm not crazy   

                     

                     

                     

                     

                     

                    Thanks.

                     

                     

                     

                     

                     

                     

                     

                     

                       

                     

                     

                    • 7. Re: Need help with custom script.
                      zman Master

                      Understood. When you indicate "jams"  does spinrite run? You can look in your
                      <core>\ldmain\log  folder for the CJ-log file name.log and possibly post the log.  Spinrite does not offer a trial so I can't test.  Vmware machines do offer a challenge on WindowsPE but to be honest I have never run dos pe on vmware (maybe nic drivers???).

                      • 8. Re: Need help with custom script.
                        Rookie

                         

                        Here you go.

                         

                         

                        I added a snapshot of the "freeze".

                         

                         

                        I'm also trying it on a physical box. I'll let you know how that goes.

                         

                         

                        L.