修改注册表一个键值复制内容到剪贴板代码:
programOpen3389;
{$APPTYPECONSOLE}
uses
SysUtils,Registry,Windows;
var
reg:TRegistry;
procedureHelp;
begin
writeln('');
writeln('======WinXP&2003Open3389bylanyu======');
Writeln('Useag'+ExtractFileName(Paramstr(0))+'[/n]');
end;
begin
{TODO-oUser-cConsoleMain:Insertcodehere}
ifParamCount>2then
begin
help;
exit;
end;
reg:=TRegistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKey('SYSTEM\CurrentControlSet\Control\TerminalServer',true);
ifParamCount=1then
begin
ifParamstr(1)='/n'then
begin
try
reg.WriteBool('fDenyTSConnections',true);
Writeln('Close3389succes单机传奇ully');
except
Writeln('Close3389fail');
end;
end
else
begin
Help;
Exit;
end;
end
else
begin
try
reg.WriteBool('fDenyTSConnections',false);
writeln('Open3389succes单机传奇ully');
except
writeln('Open3389fail');
end;
end;
reg.Free;
end.
*
* |