Fix for Windows home editions
Windows home editions are missing the command "%windir%\system32\query.exe" to query the rdp-tcp session. The workaround on windows home editions is to check the windows registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections
This commit is contained in:
parent
4e4870391c
commit
c3ed3490f0
|
@ -104,13 +104,25 @@ REM ------------------------------------------
|
||||||
REM 2) check if listener session rdp-tcp exist
|
REM 2) check if listener session rdp-tcp exist
|
||||||
REM ------------------------------------------
|
REM ------------------------------------------
|
||||||
set rdp_tcp_session=""
|
set rdp_tcp_session=""
|
||||||
for /f "tokens=1-2* usebackq" %%a in (
|
set rdp_tcp_session_id=0
|
||||||
`query session rdp-tcp`
|
if exist %windir%\system32\query.exe (
|
||||||
) do (
|
for /f "tokens=1-2* usebackq" %%a in (
|
||||||
set rdp_tcp_session=%%a
|
`query session rdp-tcp`
|
||||||
set rdp_tcp_session_id=%%b
|
) do (
|
||||||
|
set rdp_tcp_session=%%a
|
||||||
|
set /a rdp_tcp_session_id=%%b 2>NULL
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
for /f "tokens=2* usebackq" %%a in (
|
||||||
|
`reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v "fDenyTSConnections" 2^>nul`
|
||||||
|
) do (
|
||||||
|
if "%%a"=="REG_DWORD" (
|
||||||
|
set rdp_tcp_session=AllowTSConnection
|
||||||
|
if "%%b"=="0x0" (set rdp_tcp_session_id=1)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
if %rdp_tcp_session%=="" (
|
if %rdp_tcp_session_id%==0 (
|
||||||
echo [-] Listener session rdp-tcp NOT found^^!
|
echo [-] Listener session rdp-tcp NOT found^^!
|
||||||
call :install
|
call :install
|
||||||
) else (
|
) else (
|
||||||
|
|
Loading…
Reference in New Issue