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 ------------------------------------------
|
||||
set rdp_tcp_session=""
|
||||
for /f "tokens=1-2* usebackq" %%a in (
|
||||
set rdp_tcp_session_id=0
|
||||
if exist %windir%\system32\query.exe (
|
||||
for /f "tokens=1-2* usebackq" %%a in (
|
||||
`query session rdp-tcp`
|
||||
) do (
|
||||
) do (
|
||||
set rdp_tcp_session=%%a
|
||||
set rdp_tcp_session_id=%%b
|
||||
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^^!
|
||||
call :install
|
||||
) else (
|
||||
|
|
Loading…
Reference in New Issue