C # Tips Quick ways to delete bin and obj folders

Source: Internet
Author: User
C # programs always generate bin and obj folders, in order to reduce the size of the source code, it is necessary to delete the two folders, so think of a batch file to delete

The following is the code for the batch:

@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, a batch of two half-width colon at the beginning of the comment out of this line
2, copy the above code to Notepad, and name the bat suffix file, such as Clear.bat.
3. The clear.bat is best placed in the directory (or upper directory) where the delete operation is to be performed.

If you delete a file, you can remove the sentence for/r%nowpath%%%i in (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.*) changed to the file to be deleted.

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.