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 134493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:37:24+00:00 2026-05-11T06:37:24+00:00

Im looking for a way to delete Windows restore points using C# perhaps by

  • 0

Im looking for a way to delete Windows restore points using C# perhaps by invoking WMI.

Any code snippet 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. 2026-05-11T06:37:25+00:00Added an answer on May 11, 2026 at 6:37 am

    Touching on what Morten said you can use that API. WMI doesn’t provide a method to delete a Restore Point as far as I can tell. The SRRemoveRestorePoint can remove a restore point, provided you have the sequence number. You can get that through WMI. Here is my code to Remove a restore point.

    [DllImport('Srclient.dll')] public static extern int SRRemoveRestorePoint(int index);  private void button1_Click(object sender, EventArgs e) {     int SeqNum = 335;     int intReturn = SRRemoveRestorePoint(SeqNum); } 

    I just threw in 335 since that was the farthest one back as I could find on my system. Its likely that the count starts at 1 and keeps incrementing. so it isn’t as simple as just having an index like you would in an array.

    As for getting the sequence numbers, I converted the code from Microsoft to C# which will give you that info. Be sure to add System.Management as a reference. Otherwise this code won’t work right.

        private void EnumRestorePoints()     {         System.Management.ManagementClass objClass = new System.Management.ManagementClass('\\\\.\\root\\default', 'systemrestore', new System.Management.ObjectGetOptions());         System.Management.ManagementObjectCollection objCol = objClass.GetInstances();          StringBuilder Results = new StringBuilder();         foreach (System.Management.ManagementObject objItem in objCol)         {             Results.AppendLine((string)objItem['description'] + Convert.ToChar(9) + ((uint)objItem['sequencenumber']).ToString());         }          MessageBox.Show(Results.ToString());     } 

    I tested this on my box (Vista by the way) and it worked without issue. Also have to be running as Admin, but I think you figured that.

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

Sidebar

Ask A Question

Stats

  • Questions 121k
  • Answers 121k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Below is my PHP implementation of my algorithm to calculate… May 12, 2026 at 12:33 am
  • Editorial Team
    Editorial Team added an answer The majority (if not all) of valid uses for setup… May 12, 2026 at 12:33 am
  • Editorial Team
    Editorial Team added an answer The way I would do it is to simply go… May 12, 2026 at 12:33 am

Related Questions

I know this is not programming directly, but it's regarding a development workstation I'm
I am looking for a way to delete all files older than 7 days
The title says it. I'm looking for a way to determine exactly which file/registry
I was looking for a way to create hard links under Windows and I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.