Help to use Custom Inventory Rule
Hi all!
I've been racking my brain to make a list of devices that don't have a certain software file. I tried to do a CIR, but I don´´ have positive results.
Could you help me with list of devices that don't have a specific file?
Or I need to use the script module?
thanks!
Answers (4)
Found this CIR, gives you a yes or no:
ShellCommandTextReturn(>nul 2>nul dir /a-d "C:\Path\test.txt" && (echo Yes) || (echo No))
To check for a folder exists, use a * at the end. example, "c:\path\folder\*"
https://stackoverflow.com/questions/10813943/check-if-any-type-of-files-exist-in-a-directory-using-batch-script
I don't think that there is a CIR such as "FileDontExists()" (which will be great). I am also not aware of any negative parameter to inverse FileExists.
I thing the best way to do it is to create a script which check the presence of the file and place a marker (which can be then tested with a CIR).
regards
Comments:
-
FileExists(C:\WINDOWS\\notepad.exe)
Returns a boolean (true or false) , so if false, the software item would not show that the device has the software item installed. - KevinG 3 years ago