C # quick way to delete bin and obj folders

Source: Internet
Author: User

C # programs will always generate bin and obj folders, in order to reduce the size of the source code, it is necessary to delete the two folders, and then think of a batch file to delete.

The following is the batch code:

@echo off
Set nowpath=%cd%
CD/
CD%nowpath%

::d elete Specify File (*.pdb,*.vshost.*)
FOR/R%nowpath%%%i in (*.pdb,*.vshost.*) do (del%%i)

::d elete Specify folder (Obj,bin)
FOR/R%nowpath%%%i in (obj,bin) do (IF EXIST%%i rd/s/q%%i)

Echo OK
Pause

Note:
1. Two half-width colon at the beginning of the batch processing comment out this line
2. Copy the above code into Notepad and name the file named bat suffix, such as clear.bat.
3, Clear.bat preferably put in the directory to perform the delete operation (or the upper directory)

If you delete a file, you can remove the sentence for/r%nowpath%%%i in (obj,bin) do (if EXIST%%i rd/s/q%%i) and then for/r%nowpath%%%i in (*.pdb,*.v shost.*) do (Del%%i) in this sentence (*.pdb,*.vshost.*) is changed to the file to be deleted.

C # quick way to delete bin and obj folders

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.