LoginSignup
3
4

More than 5 years have passed since last update.

復元ポイントをプログラムから有効にする

Posted at

復元ポイントを作成する

http://qiita.com/skuromaku/items/ef260ac286d13d2cbe11
復元ポイントを作成する方法は上記に記載した通り。
しかし、復元ポイントの機能が「無効」になっているとエラーになってしまう。

復元ポイントを有効にする

var obj = new System.Management.ManagementClass(@"root\default:SystemRestore");
obj.InvokeMethod("Enable", new object[] { "" });

これでCドライブの復元ポイントが有効になる。
他のドライブのときにはnew object[] { "D" }とかしたらええんかな?未検証。

参考
https://technet.microsoft.com/ja-jp/security/aa378858(v=vs.80)

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4