var
AccPermis: array[0..$67] of byte =
($01,$00,$04,$80,$30,$00,$00,$00,
$4c,$00,$00,$00,$00,$00,$00,$00,
$14,$00,$00,$00,$02,$00,$1C,$00,
$01,$00,$00,$00,$00,$00,$14,$00,
$01,$00,$00,$00,$01,$01,$00,$00,
$00,$00,$00,$01,$00,$00,$00,$00,
$01,$05,$00,$00,$00,$00,$00,$05,
$15,$00,$00,$00,$ED,$36,$0D,$7D,
$87,$1C,$0C,$57,$5F,$52,$93,$7A,
$F4,$01,$00,$00,$01,$05,$00,$00,
$00,$00,$00,$05,$15,$00,$00,$00,
$ED,$36,$0D,$7D,$87,$1C,$0C,$57,
$5F,$52,$93,$7A,$F4,$01,$00,$00);
LaunchPermis: array[0..$67] of byte =
($01,$00,$04,$80,$30,$00,$00,$00,
$4C,$00,$00,$00,$00,$00,$00,$00,
$14,$00,$00,$00,$02,$00,$1C,$00,
$01,$00,$00,$00,$00,$00,$14,$00,
$01,$00,$00,$00,$01,$01,$00,$00,
$00,$00,$00,$01,$00,$00,$00,$00,
$01,$05,$00,$00,$00,$00,$00,$05,
$15,$00,$00,$00,$A0,$5F,$84,$1F,
$5E,$2E,$6B,$49,$CE,$12,$03,$03,
$F4,$01,$00,$00,$01,$05,$00,$00,
$00,$00,$00,$05,$15,$00,$00,$00,
$A0,$5F,$84,$1F,$5E,$2E,$6B,$49,
$CE,$12,$03,$03,$F4,$01,$00,$00);
procedure TForm1.BitBtn1Click(Sender: TObject);
var
r: TRegistry;
begin
r := TRegistry.Create;
r.RootKey := HKEY_CLASSES_ROOT;
r.OpenKey('AppID/{3F750B99-4A63-4CB7-BF47-8853B5C8C5BB}', true);
//这个要看你的中间层的GUID了
r.WriteString('', 'RMDMain Object');
r.WriteBinaryData('AccessPermission', AccPermis[0], $68);
r.WriteInteger('Authen
ticationLevel', 1);
r.WriteBinaryData('LaunchPermission', LaunchPermis[0], $68);
// r.WriteString('RemoteServerName', 'workgroup');
r.WriteString('RunAs', 'Interactive User');
r.CloseKey;
r.Free;
WinExec('net user txpos_user /add /passwordchg:no /passwordreq:no /expires:never /active:yes', sw_hide);
end;