Deleting All BIN & OBJ Folders in a Visual Studio Solution

Alper Ebiçoğlu
Mar 19, 2018 · 1 min read

Sometimes it turns out that we have to delete all bin and obj folders recursively in a Visual Studio solution. There’s a built-in Visual Studio feature called Clean Solution but it doesn’t delete them all.

This is my way to for deleting all BIN and OBJ folders recursively.

  1. Create an empty file and name it DeleteBinObjFolders.bat
  2. Copy-paste code the below code into the DeleteBinObjFolders.bat
  3. Move the DeleteBinObjFolders.bat file into the same folder with your solution (*.sln) file.
@echo off
@echo Deleting all BIN and OBJ folders…
for /d /r . %%d in (bin,obj) do @if exist “%%d” rd /s/q “%%d”
@echo BIN and OBJ folders successfully deleted :) Close the window.
pause > nul
Deletes all BIN & OBJ folders with a double-click.

I hope you will benefit. Happy coding!

This article was originally published on Volosoft Blog.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store