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

  • SEARCH
  • Home
  • 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 7516805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:14:58+00:00 2026-05-30T01:14:58+00:00

I am trying to make a program that will search for a file on

  • 0

I am trying to make a program that will search for a file on all hard disks and delete it once it is found. But I don’t know how to get started in doing this?

Also I am fairly new to coding in some aspects of C# would it be possible to get an example of how to use the code in action? If so that would be very helpful.

  • 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-30T01:14:59+00:00Added an answer on May 30, 2026 at 1:14 am

    You can use DriveInfo.GetDrives() to get all the drives. Then Directory.GetFiles() on each drive’s RootDirectory (or any of the other Directory methods to iterate through the drives). You should probably check DriveType on each and omit any types that are readonly like CDROM and limited access network drives. Note that this can take some time so you should provide the user with ample feedback.

    You should also check the file attributes to ensure you have write access. Or at least catch any exceptions that File.Delete() can throw.

    • DriveInfo
    • Directory
    • File
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI all. I am trying to make little program that reads data from file
I'm trying to make a program that will delete some files and perfrom rutine
Okay so I'm trying to make a little gag program that will run away
i'm trying to make a program that will connect two points that i click
Hello I am trying to make a C# program that downloads files but I
I'm trying to make a bash script that will talk to a java program
I'm trying to make a program that will draw lines over a picturebox using
I am trying to make a program that will take as input a string
OK, so I am trying to make a program using Visual Basic that will
I'm trying to make an actionscript program that will be able to read an

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.