How can I search for a missing PATH entry using a custom inventory rule?
Then create a report that has a filter using your cir contains ;%systemroot%\system32;
Also when I checked my machine my path is ;c:\windows\system32; not %systemroot%
If you want it to show just that entry to be the only path portion in the cir you would need to pipe this command into a for do loop to filter for that.
I came up with this and as a batch file it runs great, only returns the error level of 0 or 1
echo off & echo %path% | find /i "c:\windows\system32;" & cls & echo %ERRORLEVEL%you could create a batch file attach it to the cir and then use a MI to install the batch to your machines and then call the batch file with a ShellCommandTextReturn CIR and it will give you just the 0 or 1 state. I do something like that to get a clean list of admins on my systems.
Anyway here is the cir you have in mind but since ShellCommandTextReturn records all steps of the process you are still stuck with the %path% in the cir.
shellcommandtextreturn(cmd /q /c echo %path% | find /i "c:\windows\system32;" & cls & echo %ERRORLEVEL%)and you get this