i need your help some eror when i convert is VBS code to Delphi.
thats eror code is =
For Each objItem in colItems
objItem.AddExte nsionFile _
"C:\dene.ex e", True, _
"BITSEXT", True, "BITS Update"
Next
VBS and Delphi codes in the bottom.
thaks anyway for your helps.
*************** ***********
VBS Code;
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{aut henticationLeve l=pktPrivacy}\\ " _
& strComputer & "\root\microsof tiisv2")
Set colItems = objWMIService.E xecQuery _
("Select * From IIsWebService")
For Each objItem in colItems
objItem.AddExte nsionFile _
"C:\dene.ex e", True, _
"BITSEXT", True, "BITS Update"
Next
Delphi Convert Code :) ;
function TForm1.GetObjec t(const objectName: String): IDispatch;
var
bindCtx: IBindCtx;
moniker: IMoniker;
chEaten: Integer;
begin
OleCheck(Create BindCtx(0, bindCtx));
OleCheck(MkPars eDisplayName(bi ndCtx, StringToOleStr( objectName),
chEaten,
moniker));
OleCheck(monike r.BindToObject( bindCtx, nil, IDispatch, Result));
end;
procedure TForm1.Button3C lick(Sender: TObject);
var
objWMIService: OLEVariant;
colItems: OLEVariant;
begin
objWMIService:= GetObject('winm gmts:{authentic ationLevel=pktP rivacy}\\localh ost\root\micro softiisv2');
colItems:=objWM IService.ExecQu ery('Select * From IIsWebService') ;
*************** ***
{
For Each objItem in colItems
objItem.AddExte nsionFile _
"C:\dene.ex e", True, _
"BITSEXT", True, "BITS Update"
Next
}
:(
*************** ***
end;
thats eror code is =
For Each objItem in colItems
objItem.AddExte nsionFile _
"C:\dene.ex e", True, _
"BITSEXT", True, "BITS Update"
Next
VBS and Delphi codes in the bottom.
thaks anyway for your helps.
*************** ***********
VBS Code;
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{aut henticationLeve l=pktPrivacy}\\ " _
& strComputer & "\root\microsof tiisv2")
Set colItems = objWMIService.E xecQuery _
("Select * From IIsWebService")
For Each objItem in colItems
objItem.AddExte nsionFile _
"C:\dene.ex e", True, _
"BITSEXT", True, "BITS Update"
Next
Delphi Convert Code :) ;
function TForm1.GetObjec t(const objectName: String): IDispatch;
var
bindCtx: IBindCtx;
moniker: IMoniker;
chEaten: Integer;
begin
OleCheck(Create BindCtx(0, bindCtx));
OleCheck(MkPars eDisplayName(bi ndCtx, StringToOleStr( objectName),
chEaten,
moniker));
OleCheck(monike r.BindToObject( bindCtx, nil, IDispatch, Result));
end;
procedure TForm1.Button3C lick(Sender: TObject);
var
objWMIService: OLEVariant;
colItems: OLEVariant;
begin
objWMIService:= GetObject('winm gmts:{authentic ationLevel=pktP rivacy}\\localh ost\root\micro softiisv2');
colItems:=objWM IService.ExecQu ery('Select * From IIsWebService') ;
*************** ***
{
For Each objItem in colItems
objItem.AddExte nsionFile _
"C:\dene.ex e", True, _
"BITSEXT", True, "BITS Update"
Next
}
:(
*************** ***
end;
Comment