You don't escape backslashes in strPath
. Backslashes are escape characters in WMI, so unless you turn them into literal backslashes by doubling them, the WMI query won't be able to locate the file.
Also, there's another potential glitch in the command. It uses single quotes for quoting the file name. Single quotes are valid characters in NTFS file names, though. If your script runs into a file whose name contains a single quote that character will prematurely terminate the file name string in the WMI query, and the remainder of the file name will render the query invalid. I ran into the same issue when I wrote this.
Replacing this:
Set objSecuritySettings = objWMIService.Get _
("Win32_LogicalFileSecuritySetting.Path='" & strPath & "'")
with this:
Set objSecuritySettings = objWMIService.Get _
("Win32_LogicalFileSecuritySetting.Path=""" & Replace(strPath,"\","\\") & """")
should get you rid of both problems.