title: Batch script to check if directories exist
body: <p>I have a batch script that does a windows system analysis. But in order to collect browser info, I have to check if browsers are installed. The path of all browsers depends on system architecture (Program Files or Program Files (x86)). So I also check if system is 32bit or 64bit and store the path in a variable %program_files%. But although I have google chrome in my pc, the program prints an error: "Chrome doesn't seem to be installed".
  Below is the code described:</p>
  
  <pre><code>Setlocal EnabledDelayedExpansion
  Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
  REG.exe Query %RegQry% &gt; %usbpath%CheckOS.txt
  Find /i "x86" &lt; %usbpath%CheckOS.txt &gt;   %usbpath%StringCheck.txt
  
  IF %ERRORLEVEL% == 0 (
       SET PROGRAM_FILES=%PROGRAMFILES%
  ) ELSE (
        SET "PROGRAM_FILES= %PROGRAMFILES(x86)%"
  )
  
  ECHO Check Google Chrome installation
  IF NOT EXIST "!PROGRAM_FILES!\Google\Chrome\" GOTO SKIPG_CHROME
  
  ECHO Running Google ChromeCacheView
  
  :SKIPG_CHROME
  ECHO Google Chrome doesn't seem to be installed. ChromeCacheView skipped.
  </code></pre>