参考https://cloud.tencent.com/developer/article/2295502 设置仅在2显示(注意:仅在2是独显,仅在1是非独显,仅在2的话控制台vnc不可用,仅在1的话控制台vnc可用,具体设置什么以业务为准)
MultiMonitorTool.exe来自https://www.nirsoft.net/utils/multi_monitor_tool.html
https://www.nirsoft.net/utils/multimonitortool-x64.zip
解压后,把MultiMonitorTool.exe放到Windows GPU 云服务器的C:Windows目录下
代码语言:powershell复制#具体化密码
#具体化密码
#具体化密码
#设置自动登录
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogon" /v "DefaultUserName" /d "Administrator" /t REG_SZ /f
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogon" /v "DefaultPassword" /d "密码" /t REG_SZ /f
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f
#开机计划任务启用显示2
schtasks.exe /create /tn "enable_display2" /ru Administrator /rl highest /sc ONLOGON /tr "MultiMonitorTool.exe /enable \.DISPLAY2" /f
schtasks /change /tn "enable_display2" /st 00:00 /sd 1900/01/01 /ru Administrator /rp "密码"
#开机计划任务禁用显示1
schtasks.exe /create /tn "disable_display1" /ru Administrator /rl highest /sc ONLOGON /tr "MultiMonitorTool.exe /disable \.DISPLAY1" /f
schtasks /change /tn "disable_display1" /st 00:00 /sd 1900/01/01 /ru Administrator /rp "密码"
或者利用系统自带的DisplaySwitch.exe命令,把带参数的DisplaySwitch.exe命令放在.bat/.cmd文件里放置在startup目录,这样每次重启后都能达到想要的命令效果。
仅在2:
C:WindowsSystem32DisplaySwitch.exe 1
仅在1:
C:WindowsSystem32DisplaySwitch.exe 4
设置完重启机器看效果