title: How to setpath= to Program Files if Program Files (x86) doesn't exist in batch?
body: <p><strong>Here's the script. The objective is to extract the Rar files in the folder to a particular folder. The problem is that I need the path to WinRar to change to Program Files is Program Files (x86) isn't on the system. How can I do that? Thank you!</strong> </p>
  
  <pre><code>@echo off
  @set local
  
  set dirA=C:\Users\%username%\Desktop
  
  \SpearsCraftBox\Batches
  
  set dirE=C:\Users\%username%\AppData
  
  \Roaming\.minecraft
  
  set dirC=C:\Users\%username%\Desktop
  
  \SpearsCraftBox\Batches
  
  cd %dirA%
  </code></pre>
  
  <p><strong>set path="C:\Program Files (x86)\WinRAR\";%path%</strong></p>
  
  <pre><code>echo.
  echo All files in %dirA% to be uncompressed
  echo.
  
  
  echo.
  
  FOR %%i IN (*.rar) do (
  unrar x "%%~ni.rar" "%dirE%"
  move "%%~ni.rar" "%dirC%"
  echo completed uncompressing "%%i" and moved 
  
  archives or archive to "%dirC%"
  )
  
  goto eof
  
  
  :eof
  
  echo.
  echo "Task Completed"
  echo.
  </code></pre>