我需要在Windows 10上安装诸如"LegacyCompoents“、"DirectPlay”、".NET Framework3.5“、"Windows”和"Developer“(Home/Pro x64 1909)等离线功能。
在线上,它可以正常工作(显然,以管理员的身份运行):
cls
@echo off
cd /d "%~dp0"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /v "AllowDevelopmentWithoutDevLicense" /d "1" /f >nul
dism /online /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /norestart
dism /online /enable-feature /featurename:NetFx3 /norestart
dism /online /enable-feature /featurename:LegacyComponents /norestart
dism /online /enable-feature /featurename:DirectPlay /norestart
dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart
pause
exit但是离线,我拿不到包裹。因此,我试图升级一个离线映像,以便在“/source/sxs”这样的文件夹中找到包。
我打开了Windows10的".iso“映像,这个命令给出了"Pro”安装= 6的编号。
dism /get-imageinfo /imagefile:"%cd%\Windows 10 x64\sources\install.wim"我挂上了图像。
if not exist "C:\test\offline" mkdir "C:\test\offline"
dism /mount-image /imagefile:"%cd%\Windows 10 x64\sources\install.wim" /index:6 /mountdir:"C:\test\offline"在此之前,它是有效的。但就在那之后,开发者模式就失败了。
dism /image:"C:\test\offline" /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /logpath:"%~dpn0.log"错误: 0x800f081f无法找到源文件。使用"Source“选项指定还原功能所需文件的位置。有关指定源位置的详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=243077。
之后,.NET Framework3.5也失败了,相同的错误代码。
dism /image:C:\test\offline /enable-feature /featurename:NetFx3 /logpath:"%~dpn0.log"否则,LegacyComponent、DirectPlay和Linux都能正常工作。
dism /image:C:\test\offline /enable-feature /featurename:LegacyComponents
dism /image:C:\test\offline /enable-feature /featurename:DirectPlay
dism /image:C:\test\offline /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux之后,我卸载映像,但找不到下载的包。
dism /unmount-image /mountdir:"C:\test\offline" /commit我的愿望是获得".cab“软件包,并且能够用这样的脚本安装它们:
cls
@echo off
cd /d "%~dp0"
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /v "AllowDevelopmentWithoutDevLicense" /d "1" /f >nul
dism /online /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:NetFx3 /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:LegacyComponents /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:DirectPlay /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /limitaccess /source:"%cd%\Packages" /logpath:"%~dpn0.log" /norestart
echo.
timeout 5
del /f /q "%~dpn0.log"你能帮帮我吗?
诚挚的问候,
发布于 2020-05-21 21:03:58
我想你已经找到解决办法了因为这是个老职位。我会把它写下来,以防别人在找它。
您需要下载随需应变的 Windows 10 ISO文件(为此需要Visual订阅),然后解压以下软件包:
Microsoft-OneCore-DeveloperMode-Desktop-Package~31bf3856ad364e35~amd64~~.cab
Microsoft-WebDriver-Package~31bf3856ad364e35~amd64~~.cab在安装软件包之前,通过将以下DWORD键设置为1来启用开发人员模式:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense可以使用以下命令安装该软件包:
dism /online /add-capability /capabilityname:Tools.DeveloperMode.Core~~~~0.0.1.0 /limitaccess /source:"C:\path\to\folder" /norestart我已经在一个没有访问Windows的域连接的计算机上测试了这个
(WSUS服务器通过GPO配置,双扫描被禁用).
https://stackoverflow.com/questions/60658023
复制相似问题