Scripting Question

Custom Inventory Rule if file exists echo yes

04/22/2019 455 views

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)


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


All Answers


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))
Answered 04/22/2019 by: flip1001
Black Belt

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:


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