title: How to check existence of an executable and run an installer if application is not installed?
body: <p>I am a system administrator of a server/client environment that doesn't have SCCM and I want to check if computers in my organization have a file name using a batch file.</p>
  
  <p>I want the script to check if the file <code>egui.exe</code> is in one of these directories:</p>
  
  <pre><code>Program Files\ESET\ESET Security\
  Program Files (86)\ESET\ESET Security\
  </code></pre>
  
  <p>If the file EXIST then the script should <strong>do nothing</strong>.<br>
  If the file <strong>NOT</strong> EXIST then it should start <em>Eset Endpoint</em> installation in <strong>quiet mode</strong> from my server:</p>
  
  <pre><code>msiexec /i myserver\eea_nt64_enu.msi /qb 
  </code></pre>
  
  <p>I wrote something, but I'm not sure if it is correct and complete:</p>
  
  <pre><code>If exist "C:\program files\ESET\ESET Security\egui.exe" echo ?
  else 
  call msiexec /i myserver\eea_nt64_enu.msi /qb
  </code></pre>
  
  <p>Again, I do not want the script to load the installation if the file exists.
  If the executable exists in that folder, then the batch file should do nothing.</p>
  
  <p>How to check existence of executable in <strong>Program files</strong> and <strong>Program files (x86)</strong>?  </p>
  
  <p>How to check what version each one has?</p>
  
  <p>If the version of the AntiVirus is old (let's say version 4) then it should force it to install AND override the current version?</p>