What I am trying to do is propagate a custom property field using a EEDK package
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%
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.
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?
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.
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.
Does not work: December 29
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.
That's correct. I found the same solution last night but not had a chance to update the ticket.
Thanks for the assist!