2 Replies Latest reply on May 22, 2015 3:35 AM by Monoj Padhy

    Compliance Rule - If... Then... End Statement

    Rob Slattery

      Hey everyone, I'd like to create a compliance rule using the "If... Then... End" options but I don't know how to End my script.  I'm thinking this is a fairly easy script but I'm not finding what I need within the drop down.

       

      Goal: I would like to find if a file exists and if it does, does the version at least starts with xxx (earlier version of the file) and if not, is the version installed, start with 6.1/2/3/etc. (newer version).  If these conditions match than great but if not, the rule should fail.  Here's what I have come up with and it seems to work but I need a real end statement not some "cop-out" like I inserted.

       

      image002.png

        • 2. Re: Compliance Rule - If... Then... End Statement
          Monoj Padhy

          what if the file does not exist ? simply fail the rule or do you have any specific requirement here?

           

          If you wish to simply fail the rule if the file doesn't exist then no need of if and then condition. Simply do as below.

           

          "File:/C/Windows/System32/msxml6.dll" exists  AND

          (  "File:/C/Windows/System32/msxml6.dll"."Version (Windows NTFS) (Windows)" matches "6.[1-9]*.*"  OR

             "File:/C/Windows/System32/msxml6.dll"."Version (Windows NTFS) (Windows)" does not start with "6.0.389"

          )

           

           

          if your requirement is rule should be complaint, if the file does not exists then go for if... then condition

           

          if

             "File:/C/Windows/System32/msxml6.dll" exists

          then

             (  "File:/C/Windows/System32/msxml6.dll"."Version (Windows NTFS) (Windows)" matches "6.[1-9]*.*"  OR

                "File:/C/Windows/System32/msxml6.dll"."Version (Windows NTFS) (Windows)" does not start with "6.0.389"

             )

          end

           

           

          HTH

          Monoj