問題現象:
無法啟動。
原因:通過mstsc遠程桌面連接會占用顯卡,導致調用顯卡的軟件無法成功。參考:Windows自帶遠程桌面(mstsc)在遠程時無法啟動(打開)某些應用(軟件)的解決辦法
編寫腳本,保存為xxx.cmd:
@echo off
REM 獲取當前會話ID并切換到控制臺
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console
)
REM 啟動 EPLAN
"D:\Program Files\EPLAN\Platform\2.9.4\Bin\EPLAN.exe" /Variant:"Electric P8"
最終實現成功啟動。