在Windows 7 Home Premium中接受远程桌面连接


13

Windows 7家庭高级版默认情况下不支持传入的远程桌面连接(即作为终端服务服务器)。

但是,是否存在通过注册表设置或Microsoft修补程序启用远程桌面(服务器)的方法?

一个类似的问题存在于Windows Vista Home Premium操作系统。

Answers:


12

与dll修补程序相比,RDP包装程序是更出色的解​​决方案。

优点:

  • 支持Windows Vista,7、8、10
  • 不会修改系统dll
  • 不会与将来的Windows更新冲突
  • 可用于无人值守安装
  • 具有内置fSingleSessionPerUser切换
  • 无需重启
  • 不会影响当前登录的用户

我什至可以通过活动的rdp会话安装它。它只是失去了连接片刻,然后又重新连接。


2
对于Windows 7,为了能够以非管理员用户身份远程登录,在安装RDPWrap之后,我需要按照此答案中的说明进行操作,以便为用户授予远程桌面特权。
这不是我的真实姓名,

4

您可以在Windows Home Premium计算机上启用远程桌面(终端服务)。它涉及用被黑客入侵的版本(或就地修补/黑客入侵)覆盖\ Windows \ System32 \ termsrv.dll文件,您可以从各种搜索引擎中找到该版本。

我找不到找到修补程序的确切站点,但是存在其他站点,这些站点带有修补程序要更新的DLL版本。另外,对于SP1,您可能需要其他文件。(对不起,我无法防范Link Rot,但是这些链接包含要下载的可执行文件/ DLL文件。)

我的更新带有批处理脚本,该脚本可能有助于查找我使用的确切文件:

@ECHO OFF

SETLOCAL ENABLEDELAYEDEXPANSION

SET WINVER=Windows 7 Build 7601
SET SET_PRODUCTNAME="Windows 7"
SET SET_CURRENTBUILD="7601"
SET SET_CSDBUILDNUMBER="1130"
SET SET_VERSION=%SET_CURRENTBUILD%.%SET_CSDBUILDNUMBER%

TITLE Concurrent Remote Desktop Sessions %WINVER%

:SHOWHELP
    IF /I *%1 == *-? GOTO PRINTHELP
    IF /I *%1 == *help GOTO PRINTHELP
    GOTO PERMISSIONCHK

:PRINTHELP
    ECHO This script enables concurrent remote desktop sessions
    ECHO for %WINVER%
    ECHO.
    ECHO This script must be run as an Administrator.
    ECHO To open an elevated command prompt with Administrator privileges
    ECHO press WinKey, typ cmd, and hit Ctrl+Shift+Enter.
    ECHO.
    ECHO.
    ECHO Available commandline switches:
    ECHO.
    ECHO -?        Show this help.
    ECHO help     Same as -?.
    ECHO multi    Enable multiple sessions per user.
    ECHO blank    Enable remote logon for user accounts that are not password protected.
    ECHO.
    GOTO END

:PERMISSIONCHK
    REM Note: Mikinho, Updated admin right checks to a more appropiate method

    SET HasAdminRights=0
    FOR /F %%i IN ('WHOAMI /PRIV /NH') DO (
        IF "%%i"=="SeTakeOwnershipPrivilege" SET HasAdminRights=1
    )

    IF NOT %HasAdminRights%==1 (
        ECHO.
        ECHO This script must be run as an Administrator.
        ECHO.
        ECHO Use switch -? to show help.
        ECHO.
        GOTO END
    )

:VERSIONCHECK
    REM Note: Mikinho, Improved checks...

    FOR /F "tokens=3*" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^| FIND "ProductName"') DO SET PRODUCTNAME=%%A %%B
    REM IF /I NOT "%PRODUCTNAME%" == %SET_PRODUCTNAME%  GOTO UNSUPPORTED

    FOR /F "tokens=3" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID"') DO SET EDITIONID=%%A
    IF /I NOT "%EDITIONID%" == "Ultimate" IF /I NOT "%EDITIONID%" == "Enterprise" IF /I NOT "%EDITIONID%" == "Professional" IF /I NOT "%EDITIONID%" == "HomePremium" GOTO UNSUPPORTED

    FOR /F "tokens=3" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CurrentBuild"') DO SET CURRENTBUILD=%%A
    IF /I NOT "%CURRENTBUILD%" == %SET_CURRENTBUILD%  GOTO UNSUPPORTED

    FOR /F "tokens=3" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CSDBuildNumber"') DO SET CSDBUILDNUMBER=%%A
    IF /I NOT "%CSDBUILDNUMBER%" == %SET_CSDBUILDNUMBER%  GOTO UNSUPPORTED

    GOTO START

:UNSUPPORTED
    ECHO.
    ECHO Your operating system is not supported.
    ECHO Only for %WINVER%
    GOTO END

:START
    CLS
    IF /I EXIST %SystemRoot%\SysWOW64 (SET ARCH=64) ELSE (SET ARCH=32)

:DETECTARGUMENTS
    SET SINGLESESSION=1
    SET BLANK=1
    IF /I *%1 == *MULTI SET SINGLESESSION=0
    IF /I *%2 == *MULTI SET SINGLESESSION=0
    IF /I *%1 == *BLANK SET BLANK=0
    IF /I *%2 == *BLANK SET BLANK=0

:SETSOURCEFOLDER
    REM This will get the folder the batch file was launched from since the current
    REM directory will change if launched from a network share
    SET SOURCEFOLDER=%~dp0
    ECHO Source Folder is %SOURCEFOLDER%, Windows is %ARCH%-bit
    ECHO.

:TAKEOWNERSHIP
    ECHO Taking ownership of %SystemRoot%\System32\termsrv.dll
    takeown /a /f %SystemRoot%\System32\termsrv.dll
    ECHO Granting Administrators rights
    ICACLS %SystemRoot%\System32\termsrv.dll /Grant "%USERNAME%":F
    ICACLS %SystemRoot%\System32\termsrv.dll /Grant Administrators:F

:STOPTERMINALSERVICES
    ECHO Stopping Remote Desktop Services
    REM Update: Mikinho, changed to TermService for globalization
    NET stop TermService /y

:BACKUPTERMSRVDLL
    IF /I EXIST %SystemRoot%\System32\termsrv.dll.%SET_VERSION%.bak GOTO PATCHED
    COPY "%SystemRoot%\System32\termsrv.dll" "%SystemRoot%\System32\*.*.%SET_VERSION%.bak"

:COPYTERMSRVDLL 
    IF /I NOT EXIST "%SOURCEFOLDER%%ARCH%_termsrv.dll" (
        ECHO.
        ECHO The %ARCH% version of termsrv.dll is not present
        ECHO.
        ECHO Use switch -? to show help.
        ECHO.
        GOTO END
    )

    ECHO Copying "%SOURCEFOLDER%%ARCH%_termsrv.dll" to "%SystemRoot%\System32\termsrv.dll"
    COPY /Y "%SOURCEFOLDER%%ARCH%_termsrv.dll" "%SystemRoot%\System32\termsrv.dll"

    GOTO IMPORTREGKEYS

:PATCHED
    ECHO ######################################
    ECHO # Patched Already ,Config Editing... #
    ECHO ######################################

:IMPORTREGKEYS
    ECHO Enabling RDP
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

:HOMEPREMIUM
    IF /I "%EDITIONID%" == "HomePremium" (
        NETSH advfirewall firewall delete rule name="Remote Desktop (TCP-In)"
        NETSH advfirewall firewall add rule name="Remote Desktop (TCP-In)" program=System profile=public,private,domain dir=in localport=3389 protocol=tcp action=allow description="Inbound rule for the Remote Desktop service to allow RDP traffic. [TCP 3389]"
        COPY /Y "%SOURCEFOLDER%%ARCH%_rdpclip.exe" "%SystemRoot%\system32\rdpclip.exe"
    )

:SETSINGLESESSIONSETTING
    ECHO Setting fSingleSessionPerUser to %SINGLESESSION%
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fSingleSessionPerUser /t REG_DWORD /d %SINGLESESSION% /f

:SETBLANKPASSWORDPOLICY
    ECHO Setting LimitBlankPasswordUser to %BLANK%
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d %BLANK% /f

:CONFIGUREFIREWALL
    ECHO Configuring Remote Desktop in Windows Firewall
    NETSH advfirewall firewall set rule group="remote desktop" new enable=Yes

:STARTTERMINALSERVICES
    ECHO Starting Remote Desktop Services
    REM Update: Mikinho, changed from "Remote Desktop Services" for globalization
    NET START TermService

:PAUSE5SECONDS
    ECHO Pausing 5 seconds to give service time to start listening
    CHOICE /n /c y /d y /t 5 > nul

:CHECKIFSERVICELISTENING
    ECHO Checking if Service is listening on port 3389
    SUBST
    NETSTAT -a | find /i "3389"
    IF ERRORLEVEL 1 GOTO SERVICENOTLISTENING

:SERVICEISLISTENING
    ECHO Service is listening
    ECHO Done
    GOTO END

:SERVICENOTLISTENING
    ECHO Service is not listening

:CONTINUE
    ECHO Done

:END

ENDLOCAL

PAUSE

EXIT /B

2
回答的Windows Vista Home Premium操作系统这个问题的认识是,OP是问关于Vista,而不是7之前
palswim
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.