第一步:编写bat
新建一个bat,注意格式要存为ANSI的,然后以管理员权限测试下运行这个脚本,如果运行后Moonlight可以正常使用,说明没问题。放到C/ProgramFile(x86)下
@%windir%\System32\tscon.exe 0 /dest:console
@%windir%\System32\tscon.exe 1 /dest:console
@%windir%\System32\tscon.exe 2 /dest:console
net stop NvContainerLocalSystem
net start NvContainerLocalSystem
第二步:创建自动化任务
在Windows搜索中 搜索 ”任务计划程序“
步骤1 - 开启后点击创建任务
步骤二 - 任务明细照着下图这些填选
最后保存,以后每次断开远程桌面链接都会启动脚本,自动恢复Moonlight服务可用性。注意,此脚本相当于自动登入,请注意电脑如果周边有人注意隐私。