/build/static/layout/Breadcrumb_cap_w.png

Custom Inventory Rule if file exists echo yes

I know this probably has been asked before but I couldn't find it.

I'm wondering if someone can help me. I'm looking to create a custom inventory rule for if file exists echo yes or else no. Something like this below but of course that didn't work.

ShellCommandTextReturn(cmd /c if EXIST C:\ProgramData\Quest\KACE\downloads\64190\setup.exe echo Yes else echo No)

Edit:

I got it to work with just ShellCommandTextReturn(cmd /c if EXIST "C:\ProgramData\Quest\KACE\downloads\64190\setup.exe" echo Yes) but can't figure out how to do the No part.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: flip1001 4 years ago
Black Belt
0

I can confirm the CIR will work like this:

ShellCommandTextReturn(cmd /c if EXIST "C:\ProgramData\Quest\KACE\downloads\64190\setup.exe" (echo Yes) ELSE (echo No))

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ