procedure TForm1.Button1Click(Sender: TObject);
function CutParam(s:String):String;
var i:Integer;
begin
i:=AnsiPos('.EXE',UpperCase(s));
if i=0 then
begin
Result:='';
Exit;
end;
if Copy(s,0,1)='"' then
Result:=Copy(s,2,i-2)+'.EXE'
else
Result:=Copy(s,0,i-1)+'.EXE';
end;
var s:String;
begin
with TRegistry.Createdo
try
RootKey := HKEY_CLASSES_ROOT;
OpenKey('/http/shell/open/command',False);
s := CutParam(ReadString(''));
finally
Free;
end;
WinExec(PChar(s),1);
end;
满意不?