找回密码
 加入
搜索
查看: 15632|回复: 26

[原创] 设置远程桌面的代码

 火... [复制链接]
发表于 2011-5-27 23:42:04 | 显示全部楼层 |阅读模式
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.0.0
Author:         pangchangjiang

Script Function:
        Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#Include <WinAPI.au3>
               
ProgressOn("处理中,请稍候...BY:pangchangjiang", "", "", -1, -1, 2 + 16)

ProgressSet(0, "已完成 0%", "正在设置允许空白密码的用户远程登录")

sleep(300)

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa", "limitblankpassworduse", "REG_DWORD", "00000000")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa", "limitblankpassworduse", "REG_DWORD", "00000000")

If Not WinActive("处理中,请稍候", "")  Then WinActivate("处理中,请稍候", "")

ProgressSet(10, "已完成 10%", "正在启动远程相关服务")
sleep(300)

RunWait(@ComSpec & " /c sc config   RDSessMgr start= auto", "", @SW_HIDE)       
RunWait(@ComSpec & " /c net start   RDSessMgr", "", @SW_HIDE)

RunWait(@ComSpec & " /c sc config   NtLmSsp start= auto", "", @SW_HIDE)       
RunWait(@ComSpec & " /c net start   NtLmSsp", "", @SW_HIDE)

RunWait(@ComSpec & " /c sc config   TlntSvr start= auto", "", @SW_HIDE)       
RunWait(@ComSpec & " /c net start   TlntSvr", "", @SW_HIDE)

RunWait(@ComSpec & " /c sc config   RasAuto start= auto", "", @SW_HIDE)       
RunWait(@ComSpec & " /c net start   RasAuto", "", @SW_HIDE)

RunWait(@ComSpec & " /c sc config   RasMan start= auto", "", @SW_HIDE)       
RunWait(@ComSpec & " /c net start   RasMan", "", @SW_HIDE)

RunWait(@ComSpec & " /c sc config   RemoteRegistry start= auto", "", @SW_HIDE)       
RunWait(@ComSpec & " /c net start   RemoteRegistry", "", @SW_HIDE)

If Not WinActive("处理中,请稍候", "")  Then WinActivate("处理中,请稍候", "")

ProgressSet(20, "已完成 20%", "正在设置允许用户远程连接到此计算机")

sleep(300)

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server", "fAllowToGetHelp", "REG_DWORD", "00000001")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server", "fDenyTSConnections", "REG_DWORD", "00000000")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server", "fAllowToGetHelp", "REG_DWORD", "00000001")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server", "fDenyTSConnections", "REG_DWORD", "00000000")

If Not WinActive("处理中,请稍候", "")  Then WinActivate("处理中,请稍候", "")
       
ProgressSet(40, "已完成 40%", "正在设置远程端口")

sleep(300)

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")

If Not WinActive("处理中,请稍候", "")  Then WinActivate("处理中,请稍候", "")
       
ProgressSet(60, "已完成 60%", "正在关闭防火墙")

sleep(300)

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile", "EnableFirewall", "REG_DWORD", "00000000")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")

If Not WinActive("处理中,请稍候", "")  Then WinActivate("处理中,请稍候", "")
       
ProgressSet(80, "已完成 80%", "正在设置ghost重定向")

sleep(300)

$iscfgpath="HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000 [1 7 17]"
FileDelete(@TempDir&"\regini.ini")
$urlfile=FileOpen(@TempDir&"\regini.ini",1)
FileWrite($urlfile,$iscfgpath)  
FileClose($urlfile)
RunWait(@ComSpec & " /c " & "regini "&@TempDir&"\regini.ini","",@SW_HIDE)               
FileDelete(@TempDir&"\regini.ini")
   
;RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "ClassGUID", "REG_SZ", "{4D36E97D-E325-11CE-BFC1-08002BE10318}")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Class", "REG_SZ", "System")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "HardwareID", "REG_MULTI_SZ", "ROOT\RDPDR")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Driver", "REG_SZ", "{4D36E97D-E325-11CE-BFC1-08002BE10318}\0030")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Mfg", "REG_SZ", "(标准系统设备)")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Service", "REG_SZ", "rdpdr")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "DeviceDesc", "REG_SZ", "终端服务器设备重定向器")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "ConfigFlags", "REG_DWORD", "00000000")

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Capabilities", "REG_DWORD", "00000000")

If Not WinActive("处理中,请稍候", "")  Then WinActivate("处理中,请稍候", "")
       
ProgressSet(100, "已完成 100%", "已经完成")

sleep(500)

ProgressOff()

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +10 贡献 +1 收起 理由
wsfda + 10 + 1 继续加油

查看全部评分

发表于 2011-5-28 11:42:26 | 显示全部楼层
努力加油,顺便占楼
发表于 2011-5-28 21:23:00 | 显示全部楼层
远程主要是速度慢
发表于 2011-6-27 21:01:37 | 显示全部楼层
不错加油。。。
发表于 2011-6-27 21:25:05 | 显示全部楼层
努力加油,顺便占楼
发表于 2011-7-5 08:45:41 | 显示全部楼层
可以不被注销吗?不用密码登录吗?
发表于 2011-7-5 08:46:05 | 显示全部楼层
可以不被注销吗?不用密码登录吗?
发表于 2011-7-5 08:46:11 | 显示全部楼层
可以不被注销吗?不用密码登录吗?
发表于 2011-7-5 09:42:15 | 显示全部楼层
好像代码不行啊
发表于 2011-7-5 09:42:48 | 显示全部楼层
再试试怎么样?
发表于 2011-7-5 09:43:06 | 显示全部楼层
再试试怎么样?又没钱了,赚点钱用用
发表于 2011-7-30 03:56:33 | 显示全部楼层
发表于 2011-10-11 11:56:31 | 显示全部楼层
下载看看 好像挺厉害的
发表于 2011-12-21 21:46:15 | 显示全部楼层
下载看看 好像挺厉害的
发表于 2011-12-22 08:45:54 | 显示全部楼层
好强大,好厉害!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-29 07:50 , Processed in 0.081443 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表