7 Replies Latest reply on Dec 30, 2015 3:37 PM by ugenem00

    EEDK and Client Task Command Line

    ugenem00

      I would like to create a EEDK custom package that will accept a value from the Command Line in a Client Task. This date will feed a variable in the script that runs on the client.

      Any ideas?

       

      (e g) Put a date in Custom Property 4 for the McAfee Agent

        • 1. Re: EEDK and Client Task Command Line
          andrep1

          look at this package from Tory Campbell, it does pick up the command line parameter

          ePO App: Shutdown or Reboot System from ePO

          • 2. Re: EEDK and Client Task Command Line
            ugenem00

            What I am trying to do is propagate a custom property field using a EEDK package

             

                 @echo off

                 pushd "%~dp0"

                 if "%*" == "" (EXIT) Else set cmdstr=%*

             

                 REM Windows operating system command string syntax: maconfig -custom -prop1 "Property 1" -prop2 "Property 2" -prop3 "Property 3" -prop4 "Property 4" ( up to 4 values can be entered ) to initialize the date field

             

                 IF EXIST "%ProgramFiles%\McAfee\Agent\maconfig.exe" "%ProgramFiles%\mcafee\Agent\maconfig.exe" -custom -prop3 %cmdstr%

                 IF EXIST "%ProgramFiles(x86)%\McAfee\Common Framework\maconfig.exe" "%ProgramFiles(x86)%\mcafee\common framework\maconfig.exe" -custom -prop3 %cmdstr%

             

                 popd

                 Exit /B 1707

             

            In the Client task command field, I have "Date Thu 12/24/2015"


            I cannot find any errors recorded in the logs and the field does not get updated.

            • 3. Re: EEDK and Client Task Command Line
              ugenem00

              I ran the bat file directly on a client machine and it set prop3 as shown above. It just doesn't work when I do it from a client task with the date information in the command line. How can I find where the error is occurring?

              • 4. Re: EEDK and Client Task Command Line
                andrep1

                drop all your variables and see if that makes a difference, you have to remember you are running under the system account.

                Alternatively, echo to a file your 2 major line of codes to validate how it is rendered.

                • 5. Re: EEDK and Client Task Command Line
                  ugenem00

                  I think I found the problem. It seems it does not like the IF EXIST statement.

                  I first dropped the variables and hardcoded the full path, still no good.

                  I removed the IF EXIST statement and it worked!

                   

                  "C:\Program Files\mcafee\Agent\maconfig.exe" -custom -prop3 %cmdstr%

                  "C:\Program Files(x86)%\mcafee\Common Framework\maconfig.exe" -custom -prop3 %cmdstr%

                   

                  But I also noted that when the command string has spaces, it does not work. I tried with and without the double-quotes. Not sure what to do.

                   

                  Works: December

                  Does not work: December 29

                  • 6. Re: EEDK and Client Task Command Line
                    andrep1

                    Enclose your %cmdstr% in quotes.

                    I do much better in vbs that batch files, but how about the following:

                    "C:\Program Files\mcafee\Agent\maconfig.exe" -custom -prop3 "%cmdstr%"

                     

                    It works at my end with variables containing spaces.

                    • 7. Re: EEDK and Client Task Command Line
                      ugenem00

                      That's correct. I found the same solution last night but not had a chance to update the ticket.

                      Thanks for the assist!