title: Uninstall Applications via Reg Keys
body: <p>I created a script to uninstall an application silently from the reg keys. It's worked for a few different apps without an issue. I'm trying to uninstall brave browser but, I keep getting this error below. I think the reason is because the uninstall string for brave is</p>
  <p>C:\Program Files\BraveSoftware\Brave-Browser\Application\95.1.31.91\Installer\setup.exe&quot; --uninstall --system-level.</p>
  <p>The --uninstall and --system-level may be causing the error and I'm not to sure how to get around it.</p>
  <p>Any ideas are greatly appreciated.</p>
  <p>Error Message Below</p>
  <p>Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
  At line:11 char:40</p>
  <ul>
  <li>... isplayName){Start-Process -Wait -FilePath &quot;$remove32&quot; -ArgumentList &quot;</li>
  </ul>
  <hr />
  <p>$appName = &quot;brave&quot;</p>
  <p>$32bit = get-itemproperty 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall*'| Where-Object { $<em>.DisplayName -match &quot;^<em>$appName</em>&quot;} | Select-Object DisplayName, DisplayVersion, UninstallString| Where-Object { $</em>.DisplayName -match &quot;^<em>$appName</em>&quot;}</p>
  <p>$remove32 = $32bit.UninstallString</p>
  <p>$64bit = get-itemproperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall*' | Where-Object { $<em>.DisplayName -match &quot;^<em>$appName</em>&quot;} | Select-Object DisplayName, DisplayVersion, UninstallString | Where-Object { $</em>.DisplayName -match &quot;^<em>$appName</em>&quot;}</p>
  <p>$remove64 = $64bit.uninstallstring</p>
  <p>if ($appName -like $32bit.DisplayName){Start-Process -Wait -FilePath $remove32 -ArgumentList &quot;/S&quot; -PassThru}</p>
  <p>else {Start-Process -Wait -FilePath $remove64 -ArgumentList &quot;/S&quot; -PassThru}<code>enter code here</code></p>