title: Batch - Loop through folders and run command
body: <p>I am trying to remove Dropbox from around 500+ Windows 7 computers using a batch script. Dropbox is installed on a per-user basis under <strong>"%APPDATA%\Dropbox"</strong>.</p>
  
  <p>To uninstall silently you have to run <strong>"%APPDATA%\Dropbox\bin\DropboxUninstaller.exe /S"</strong>. I have tested this command and it works fine, but the problem is it only uninstalls it from the user directory you run it from. I have tried taking the DropboxUninstaller.exe file and running it from the root of C:, but it fails.</p>
  
  <p>I will be pushing this script out via SCCM, so it will run under the SYSTEM account. I need to find a way to loop between all of the user direcories, find which profiles have the Dropbox\bin\DropboxUninstaller.exe path/file and run it in that location.</p>
  
  <p>I have tested logging in as another user (local admin) and running the Dropbox uninstaller from another users directory, and it uninstalls fine for the user whos directory I run it in, so I know this will work.</p>
  
  <p>If anyone could help me out with the correct command, that would be great! I have googled around for an answer, but it doesn't seem to be out there.</p>
  
  <p>Thanks in advance,</p>