|
3#

楼主 |
发表于 2025-1-31 19:22:49
|
只看该作者
本帖最后由 音乐与电脑 于 2025-1-31 19:27 编辑
@echo off&color 1f&mode con cols=52 lines=26
pushd %~dp0 & cd /d "%~dp0"
:menu
cls
echo.
echo.====================================================
echo. Windows Server 2022 20348 21H2(22H2) 版本互换
echo.====================================================
echo.
echo. [1] 转为Win10专业版 [可数字激活]
echo.
echo. (还没改完)
echo.
echo.----------------------------------------------------
echo.转WIN11后可解除部分软件和驱动限制Server不能安装问题
echo.----------------------------------------------------
echo.如需更新系统打补丁请转回Win2025 Server,系统会更稳定
echo.----------------------------------------------------
echo.
choice /C:1234567891011121314 /N /M "**请输入1-14: [如退出请直接关闭本窗口]"
if errorlevel 1 (set "os=10" & set "key=VK7JG-NPHTM-C97JM-9MPGT-3V66T"&set "EditionID=Professional"&set "winos=Win10专业版")
if errorlevel 2 (set "os=10" & set "key=XGVPP-NMH47-7TTHJ-W3FW7-8HV2C"&set "EditionID=Enterprise"&set "winos=Win10企业版")
if errorlevel 3 (set "os=10" & set "key=DXG7C-N36C4-C4HTG-X4T3X-2YV77"&set "EditionID=ProfessionalWorkstation"&set "winos=Win10专业工作站版")
if errorlevel 4 (set "os=10" & set "key=YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY"&set "EditionID=Education"&set "winos=Win10教育版")
if errorlevel 5 (set "os=10" & set "key=YYVX9-NTFWV-6MDM3-9PT4T-4M68B"&set "EditionID=EnterpriseG"&set "winos=Win10政企版")
if errorlevel 6 (set "os=10" & set "key=KCNVH-YKWX8-GJJB9-H9FDT-6F7W2"&set "EditionID=EnterpriseS"&set "winos=Win10 LTSC企业版")
if errorlevel 7 (set "os=10" & set "key=XQQYW-NFFMW-XJPBH-K8732-CKFFD"&set "EditionID=IoTEnterprise"&set "winos=Win10 IoT企业版")
if errorlevel 8 (set "os=10" & set "key=QPM6N-7J2WJ-P88HH-P3YRH-YY74H"&set "EditionID=IoTEnterpriseS"&set "winos=Win10 IoT LTSC 企业版")
if errorlevel 9 (set "os=10" & set "key=VK7JG-NPHTM-C97JM-9MPGT-3V66T"&set "EditionID=ProfessionalCountrySpecific"&set "winos=Win10限定国家专业版")
if errorlevel 10 (set "os=10" & set "key=8PTT6-RNW4C-6V7J2-C2D3X-MHBPB"&set "EditionID=ProfessionalEducation"&set "winos=Win10专业教育版")
if errorlevel 11 (set "os=10" & set "key=W269N-WFGWX-YVC9B-4J6C9-T83GX"&set "EditionID=ProfessionalSingleLanguage"&set "winos=Win10单语言专业版")
if errorlevel 12 (set "os=10" & set "key=CPWHC-NT2C7-VYW78-DHDB2-PG3GK"&set "EditionID=ServerRdsh"&set "winos=Win10多会话版")
if errorlevel 13 (set "os=Win2022Datacenter" & set "key=WX4NM-KYWYW-QJJR4-XV3QB-6VM33"&set "EditionID=ServerDatacenter"&set "winos=Win服务器 数据中心版")
if errorlevel 14 cls & echo 按任意键将重启电脑[如不想重启请直接关闭本窗口]… & pause> nul&shutdown /r /f /t 1 & exitnul&shutdown /r /f /t 1 & exit
cls
echo.
rem 判断系统是否存在转换文件,存在就跳转到ChangeAuthority
if exist "%windir%\BrandingWin10.21H2_22H2" (
goto ChangeAuthority
)
echo 首次转换,备份原系统skus和Branding…
takeown /f "%windir%\System32\spp\tokens\skus" /r /d y > nul
icacls "%windir%\System32\spp\tokens\skus" /grant:r administrators:F /T > nul
takeown /f "%windir%\Branding" /r /d y > nul
icacls "%windir%\Branding" /grant:r administrators:F /T > nul
xcopy "%windir%\System32\spp\tokens\skus" "%windir%\System32\spp\tokens\skusB" /q /s /e /c /i /y > nul
ren "%windir%\Branding" "BrandingB" > nul
echo 首次转换,拷贝转换版本所需的文件到系统…
xcopy "%~dp0skus-21H2.20348" "%windir%\System32\spp\tokens\skus" /q /s /e /c /i /y > nul
xcopy "%~dp0BrandingWin10.21H2_22H2" "%windir%\BrandingWin10.21H2_22H2" /q /s /e /c /i /y > nul
xcopy "%~dp0BrandingWin2022.20348" "%windir%\BrandingWin2022.20348" /q /s /e /c /i /y > nul
:ChangeAuthority
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CompositionEditionID" /t REG_SZ /d "%EditionID%" /f > nul
if "%EditionID%"=="IoTEnterpriseS" ( reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CompositionEditionID" /t REG_SZ /d "EnterpriseS" /f > nul )
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" /t REG_SZ /d "%EditionID%" /f > nul
echo 请耐心等待安装许可证,需2-5分钟…
cscript /nologo %SystemRoot%\System32\slmgr.vbs /rilc > nul
if "%os%"=="Win2022Datacenter" goto Win2022Datacenter
echo 正在将系统转换为%winos%,请等待…
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "InstallationType" /t REG_SZ /d "Client" /f > nul
xcopy "%windir%\BrandingWin10.21H2_22H2\*" "%windir%\Branding" /q /s /e /c /i /y > nul
cscript /nologo %SystemRoot%\System32\slmgr.vbs /ipk %key% |find "错误"&&(pause&exit)
echo 已将系统转换为%winos%
echo 请重启电脑,完成%winos%的转换
echo 按任意键返回主菜单…
start slmgr.vbs /xpr&winver
start mshta vbscript:msgbox("请重启电脑后,使系统完整的运行于转换后的%winos%!!",64,"请重启电脑")(window.close)
pause> nul&goto :menu
:Win2022Datacenter
echo 正在将系统转换为%winos%,请等待…
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "InstallationType" /t REG_SZ /d "Server" /f > nul
xcopy "%windir%\BrandingWin2022.20348\*" "%windir%\Branding" /q /s /e /c /i /y > nul
cscript /nologo %SystemRoot%\System32\slmgr.vbs /ipk %key% |find "错误"&&(pause&exit)
echo 已将系统转换为%winos%
echo 请重启电脑,完成%winos%的转换
echo 按任意键返回主菜单…
start slmgr.vbs /xpr&winver
start mshta vbscript:msgbox("请重启电脑,使系统完整的运行于转换后的%winos%!!",64,"请重启电脑")(window.close)
pause> nul&goto :menu
|
|