创建一个系统返回点(XP)

I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
...create a System Restore point (XP)? Author: Thomas Stutz
Homepage: http://www.swissdelphicenter.com
{
If you haven't installed the Microsoft Scripting Control yet
(TScriptControl component),
download it from http://www.msdn.microsoft.com/scripting/
Once you've downloaded and run the installation, start Delphi and go to the
Component | Import ActiveX Control... menu.
Select "Microsoft Script Control 1.0" from the Listbox amd click "Install"
to install the component into Delphi's palette.
What you should end up with now is a TScriptControl component on your ActiveX tab.
Start a new application, and drop a TButton, and a TScriptControl onto the main form.
In the OnClick event of Button1, put the following code:
}
procedure TForm1.Button1Click(Sender: TObject);
var
sr: OLEVAriant;
begin
ScriptControl1.Language := 'VBScript';
sr := ScriptControl1.Eval('getobject("winmgmts://./root/default:Systemrestore")');
if sr.CreateRestorePoint('Automatic Restore Point', 0, 100) = 0 then
ShowMessage('New Restore Point successfully created.')
else
ShowMessage('Restore Point creation Failed!');
end;
 

Similar threads

I
回复
0
查看
399
import
I
I
回复
0
查看
2K
import
I
I
回复
0
查看
1K
import
I
I
回复
0
查看
2K
import
I
顶部