{"id":106,"date":"2004-08-11T17:14:57","date_gmt":"2004-08-11T22:14:57","guid":{"rendered":"http:\/\/192.168.33.66\/wp\/?p=106"},"modified":"2004-08-11T17:14:57","modified_gmt":"2004-08-11T22:14:57","slug":"turn-off-system-restore-script","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=106","title":{"rendered":"turn off system restore script"},"content":{"rendered":"<p>\nfor Windows XP only, you can even script this. The Microsoft<br \/>\nTechNet Script Center has a sample script that&#8217;ll get you <br \/>\nstarted: <br \/>\nhttp:\/\/www.microsoft.com\/technet\/community\/scriptcenter\/compmgmt\/scrcm92.mspx <br \/>\nor http:\/\/snipurl.com\/8bsr . Here&#8217;s an expanded version that <br \/>\nattempts to disable System Restore for every computer listed in a <br \/>\ntext file you provide:<\/p>\n<p>&#8216;get input file name<br \/>\nDim sInputFile<br \/>\nsInputFile = _<br \/>\n   InputBox(&#8220;Enter path and filename to input file&#8221; &#038; _<br \/>\n   &#8220;(list of computer names&#8221;, &#8220;Input file&#8221;)<\/p>\n<p>&#8216;clicked cancel?<br \/>\nIf sInputFile = &#8220;&#8221; Or sInputFile = -1 Then<br \/>\n   WScript.Quit<br \/>\nEnd If<\/p>\n<p>&#8216;open input file<br \/>\nDim oFSO, oTS<br \/>\nSet oFSO = WScript.CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\nOn Error Resume Next<br \/>\nSet oTS = oFSO.OpenTextFile(sInputFile)<br \/>\nIf Err <> 0 Then<br \/>\n   MsgBox &#8220;Couldn&#8217;t open input file.&#8221;<br \/>\n   WScript.Quit<br \/>\nEnd If<br \/>\nOn Error Goto 0<\/p>\n<p>&#8216;go through names in file<br \/>\nDim sComputer, oPing, oStatus<br \/>\nDo Until oTS.AtEndOfStream<\/p>\n<p>   &#8216;get name<br \/>\n   sComputer = oTS.ReadLine<\/p>\n<p>   &#8216;name provided?<br \/>\n   If sComputer <> &#8220;&#8221; Then<\/p>\n<p>      &#8216;connect to the WMI provider <br \/>\n      On Error Resume Next<br \/>\n      Set oWMIService = GetObject(&#8220;winmgmts:\\\\&#8221; &#038; _<br \/>\n      sComputer &#038; &#8220;\\root\\default&#8221;) <br \/>\n      Set oItem = oWMIService.Get(&#8220;SystemRestore&#8221;) <br \/>\n      errResults = oItem.Disable(&#8220;&#8221;) <br \/>\n      On Error Goto 0 <\/p>\n<p>   End If<br \/>\n   Loop<\/p>\n<p>&#8216;finished &#8211; notify<br \/>\noTS.Close<br \/>\nMsgBox &#8220;Script is finished executing.&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>for Windows XP only, you can even script this. The Microsoft TechNet Script Center has a sample script that&#8217;ll get you started: http:\/\/www.microsoft.com\/technet\/community\/scriptcenter\/compmgmt\/scrcm92.mspx or http:\/\/snipurl.com\/8bsr . Here&#8217;s an expanded version that attempts to disable System Restore for every computer listed &#8230; <a class=\"more-link\" href=\"http:\/\/www.wildow.com\/blog\/?p=106\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=106"}],"version-history":[{"count":0,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/106\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}