安装
从这里下载RDPWrap https://github.com/stascorp/rdpwrap/releases/的zip包
解压后,运行install.bat
。
随后打开https://github.com/sebaxakerhtc/rdpwrap.ini/blob/master/rdpwrap.ini,复制文本内容,替换到C:\Program Files\RDP Wrapper\rdpwrap.ini
里,然后重启服务。
重启服务
以管理员身份运行CMD
:
1 2
| net stop termservice //关闭服务 net start termservice //启动服务
|
检查
随后打开解压的RDPWrap文件夹里的RDPConf.exe
检查RDP是否能够使用。
如果如下图一样右侧值全部为绿色,则表示配置成功,随后可以运行RDPCheck.exe
,如果可以连接,则表示配置成功。
注:建议将默认端口3389修改为其他端口。
如果Listener state为 Not listening,则表示rdpwrap.ini
需要更新,按照上述步骤重新获取rdpwrap.ini
并替换,然后重启服务。
注:每当Windows更新,都需要更新一下rdpwrap.ini
。
自动更新程序
可以利用该程序自动更新rdpwrap.ini
,将该程序设置为开机启动即可。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| import ctypes import sys import requests import os ver = "1.0.2"
def is_admin(): try: return ctypes.windll.shell32.IsUserAnAdmin() except: return False
if is_admin(): print("已经获得管理员权限") else: print("没有获得管理员权限") ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
url = "https://cdn.jsdelivr.net/gh/sebaxakerhtc/rdpwrap.ini@latest/rdpwrap.ini" path = r"C:\Program Files\RDP Wrapper\rdpwrap.ini" stopWrap = "net stop termservice /y" startWrap = "net start termservice"
print("开始检查更新") try: r = requests.get(url) except Exception as e: print(e) sys.exit(1)
text = r.text webOffset = text.find("Updated=") webUpdated = text[webOffset+8:webOffset+18] print("网络版本: ",webUpdated)
localUpdated = "" with open(path, "r") as f: for line in f: if "Updated=" in line: localUpdated = line[8:18] break print("本地版本: ",localUpdated)
if webUpdated == localUpdated: print("已经是最新版本") sys.exit(0)
print("需要更新") try: with open(path, "wb") as f: f.write(r.content) except Exception as e: print(e) sys.exit(1)
os.system(stopWrap) os.system(startWrap) print("更新成功")
|