• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

System Restore deleted my C Sharp files! -- how to prevent this?

I installed a program on my Windows Vista Business system.  It locked the computer up.  So I booted into Safe Mode and ran a System Restore to the latest checkpoint ... 5 days ago.

Upon rebooting, I went to My Documents\Visual Studio 2005\Projects\MyProject ... and found that my C# files were gone.  2 days work -- gone.

Since I restored in Safe Mode, I understand that I can't undo the problem.  Those files are in the bit bucket.

Now -- how do I prevent this from happening again?  System Restore isn't supposed to affect documents, photos, etc. ... but evidently .cs files are considered fair game.

Is it b/c they were under My Documents (where VS throws stuff by default)?

Thanks!
0
Daniel Wilson
Asked:
Daniel Wilson
  • 2
1 Solution
 
qz8dswCommented:
Hi Daniel,

As per http://www.vistax64.com/vista-general/101857-i-think-system-restore-deleted-lots-my-cs-files-vista-ultimate.html
The third response down by Bert Kinney.

"File type (.cs) is monitored by System Restore. ...........
And in Vista, the Documents folder is not exempt from System Restore as the
My Documents folder was in XP."

Also as per WTC's response in the same post.
"You can tell System Protection (System Restore) not backup certain
folders and files at this location in the Registry.

[HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup]" but I don't know if that works (however I do notice it takes a /s parameter which I'd assume to be sub directories)
0
 
Daniel WilsonAuthor Commented:
Thanks for the link & explanation.

No more development under Documents for me!  Not a lesson I'll forget quickly ...
0
 
qz8dswCommented:
No worries,
BUT from what I read in that post, system restore for vista will monitor all directories for extensions listed here (plus a couple of others). http://msdn.microsoft.com/en-us/library/aa378870.aspx
It's easy enough to test, make a c:\programming directory, copy one of your C# projects to that directory, create a restore point, change the project in some way and save it then go back to your restore point.

I think you will find the .CS got rolled back to before your change.
If thats the case you would need to (in my example)
Add a string value to the [HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup] registry key.

Name it Programming, and the value would be c:\programming\*.* /s
Then reboot so the system restore loads the new values. (I don't know if it's dynamic or not)
From there I would test it again, but from what I've found that should do the trick.

Cheers,
Terry
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now