5 Replies Latest reply on Sep 10, 2008 2:42 AM by delhuskie

    Pushing a batch file or DOS comand to a group of PC's

    Apprentice

      I am trying to push either a dos command or a batch file to a group of PC's

       

      I have tried using a new DOS generic task script with the following comand

       

      defrag.exe c:

       

      i then schedule  the script but it is in  a waiting state ? 

      i can run the command on the target PC and i can get to the source file on the target PC ?

       

      Any ideas ?

       

      Many thanks 

        • 1. Re: Pushing a batch file or DOS comand to a group of PC's
          MarXtar ITSMMVPGroup

          Not a good idea to use the generic DOS script as that is expecting the machin to be in DOS in order to run and would normally be looking to reboot the machine into the vboot DOS environment.

           

          Go for the batch file option.  Create you batch file that contains your command.  Test the batch file to make sure it would work on target machines.  Once tested successfully put it into your packages share and set it up as a package in LANDesk and then schedule.

           

          If you do this and assign it to a push task, scheduling it should start almost immediately.  If it sits in waiting then for whatever reason, your scheduler is not firig it off.  First thing to do is to check the Intel Scheduler Service on your core is running.  Restart to make sure.

           

          Mark Star - LANDesk Enhancements

          Home of Power State Notifier & Wake-On-WAN for LANDesk

          • 2. Re: Pushing a batch file or DOS comand to a group of PC's
            phoffmann SupportEmployee

            When launching this sort of stuff against a client, you want to consider many things.

             

            1 - Do I want the end-user to see it (if logged in) - normally, no.

            2 - Do I want to wait for this to finish (and report success / failure) ?

             

            Based on this, you need to carefully customize your command-lines ... also, defrag can take absolute AGES. I would recommend playing (first) with things like

            ""

            defrag c: -a

            ""

             

            This does just the analyse part, will show to you that it works.

             

            Now - are you using a BATCH-file or a CUSTOM SCRIPT? This question alone will have MANY implications. Custom Scripts are ONLY push-able (no policies, etc.) - but you DO have the choice to "not wait for command-lines to finish" if you want (you might want to check out the ",ASYNC" command.

             

            For example:

            ;Example 1 - Launch Calc - wait for calc to be closed (completed) then launch Notepad (wait for that to be completed
            [Machines]
            REMEXEC1=calc.exe
            REMEXEC2=notepad.exe
            

             

            This will

            1 - Launch CALC.EXE on the client

            2 - Wait for you to CLOSE calc (so that it "finishes").

            3 - THEN (and only then) Launch NOTEPAD

            4 - Wait for you to CLOSE notepad (so that it "finishes")

            5 - Now the script is complete.

             

            Compare with:

            ;Example 1 - Launch Calc - wait for calc to be closed (completed) then launch Notepad (wait for that to be completed
            [Machines]
            REMEXEC1=calc.exe, ASYNC
            REMEXEC2=notepad.exe, ASYNC
            

             

            This will:

            1 - Launch Calc.

            2 - Launch Notepad

            3 - Finish with success

             

            =======

             

            I would generally recommend using Batch-files for this, as you can use it far better to return messages/status codes. Make sure you read the BKM/White paper on "Understanding Batch File Distribution".

             

            Paul Hoffmann

            LANDesk EMEA Technical Lead

            • 3. Re: Pushing a batch file or DOS comand to a group of PC's
              phoffmann SupportEmployee

              Oh yeah - and just in case you get the idea of using OSD-DOS scripts - that is POSSIBLE, but you need to know what you're doing and need to test quite heavily. My above example will only apply for Windows-based scripts.

               

              DOS can't multitask, so ", ASYNC" can effectively be ignored if you're intending to work in DOS (not that DOS would be a great place to defrag in anyway).

               

              Paul Hoffmann

              LANDesk EMEA Technical Lead

              • 4. Re: Pushing a batch file or DOS comand to a group of PC's
                MarXtar ITSMMVPGroup

                So.....  In other words.

                 

                Do a batch file - more flexible on delivery methods.  Good call Paul on the -a since you WILL probably want this silent. :)

                 

                TEST before you try to launch since many problems are related to a none functioning batch file rather than an issue with LANDesk.  Remember as well that this will be launching from a subdirectory underneath the sdmcache directory on the client.  Make sure your tests take this into account.

                 

                Mark Star - LANDesk Enhancements

                Home of Power State Notifier & Wake-On-WAN for LANDesk

                • 5. Re: Pushing a batch file or DOS comand to a group of PC's
                  Apprentice

                  Many thanks for the info. Guys !

                   

                  I will try this as a batch file and read the resources you recommended

                  Again thanks for the help