Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3222474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:59:42+00:00 2026-05-17T15:59:42+00:00

I want to do a backup of my Projects folder. It mostly contains sub-folders

  • 0

I want to do a backup of my Projects folder. It mostly contains sub-folders for .NET projects (VS2005, VS08, and VS10).

What should I delete before doing a backup (e.g. TestResults, bin, obj); if there is something I shouldn’t delete but should ignore, what might that be; and, most importantly, how best to automate the whole process (I’m thinking batch file or better)?

What gotchas do I need to be aware of?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:59:43+00:00Added an answer on May 17, 2026 at 3:59 pm

    (EDIT: Looks like others, including Jeff Atwood, have created tools to do this.)

    Ok, figured out that it’s hard to recursively search subfolders and delete those folders matching a pattern using a batch file and cmd. Luckily, PowerShell (which is installed on Windows 7 by default, IIRC) can do it (kudos):

    get-childitem C:\Projects\* -include TestResults -recurse | remove-item -recurse -force
    

    That was based off of example 4 of the Remove-Item help entry. It searches the path, recursively, for anything (file or folder) named “TestResults” (could put a wildcard in there if wanted) and pipes the results to the Remove-Item command, which deletes them. To test it out, just remove the pipe to Remove-Item.

    How do we remove more than just one folder per statement? Input the list of folders in PowerShell’s array syntax:

    get-childitem C:\Projects\* -include bin,obj,TestResults -recurse | remove-item -recurse -force
    

    You can run this from the command prompt or similar like so (reference)

    powershell.exe -noexit get-childitem C:\Projects\* -include bin,obj,TestResults -recurse | remove-item -recurse
    

    Obvious Disclaimer

    Don’t use this method if you keep necessary files inside folders or files named bin, obj, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to take backup or restore of my oracle database through .Net code.
I want to take backup of BugTracker.Net hosted on my local and restore it
I want to keep backup of my database and import it into different System?
I want to check the integrity of a backup of a Ubuntu disk, copied
I want to write a code to backup my Sql Server 2008 Database using
I want to write simple script to copy/backup directory then remove on server startup.
Specifically, I want to create a backup of a list, then make some changes
Context I have a live running redis-server. I want to make a backup. Idea:
I am using repositoryhosting.com i downloaded my Project backup from it. I want to
I have a hosting account with servergrid.com. I want to backup my database, they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.