您可以尝试调整您的测试脚本,让他们在开始测试之前创建RDP连接,如果没有的话。这是我用我们的项目之一,以确保RDP连接处于活动状态代码:
REM check if user has an RDP session. Will store the session ID of the user in the SESSION variable
call :getsession computername username SESSION
if "%SESSION%" EQU "" (
REM initiate an RDP connection to 'computername', wait, and disconnect by killing the process
mstsc.exe /v:computername & ping -n 5 1.1.1.1 & taskkill /F /IM mstsc.exe
)
REM check again the session
call :getsession computername user SESSION
if %SESSION% NEQ "" (
echo start your tests
)
:getsession
for /F "tokens=1,2,3,4" %%i in ('query session /SERVER:%1 ^| findstr %2') do if %%j EQU %2 (SET %3=%%k) else (SET %3=%%j)
goto :eof
请注意,如果您保存您从中启动远程桌面的计算机上的凭据自动连接只进行:
cmdkey /generic:computername /user:rdp_username /pass:rdp_password
执行此操作后,mstsc.exe将能够在无用户交互的情况下连接到机器。
与AWS配置的Windows 2012没有Desktop Experience组件有关吗?可能是他们不支持服务器级操作系统。 – wangy23