powershell - Win10 : How to activate developer mode using powershell or cmd. exe?

标签 powershell windows-10

我想激活开发者模式(以使用 ubuntu 子系统),但我没有管理员帐户凭据。但是,我可以访问具有管理员权限的 cmd.exe。所以我可以打开regedit并不受限制地使用powershell。一些教程 ( this one for example ) 指出可以通过在注册表中创建或设置特殊键来轻松激活开发模式:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense



就我而言,这些键之前在注册表中不存在,所以我手动添加了它们。可悲的是,它不起作用,开发模式仍然处于非事件状态。我还尝试使用终端 ( start ms-settings: ) 打开设置应用程序并使用 GUI 启用开发模式,但似乎 start 命令忽略/刷新管理员权限并且应用程序要求提供凭据。

操作系统:Win10
构建版本:14393.1198

编辑

由于@magicandre1981 的回答,我尝试运行以下命令

DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0



但我收到了这个错误:

Deployment Image Servicing and Management tool
Version: 10.0.14393.0

Error: 11

You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer's architecture.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log



在谷歌的帮助下,我发现我必须使用位于 C:\\Windows\native 中的不同 cmd.exe 版本。 .所以我导航到那里并调用了 cmd.exe。之后我又收到一个错误,即当前目录无效,但在导航回 C:\\Windows\System32 后命令完成没有错误。但是,它仍然不起作用。我重新启动了系统,开发模式仍未激活。

最佳答案

在以管理员身份运行的 cmd.exe 中,运行以下 2 个命令:

REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"


DISM /Online /Add-Capability /CapabilityName:Tools.DeveloperMode.Core~~~~0.0.1.0

根据您运行的 Windows 10 Build,您可能需要重新启动系统才能完成设置。

要启用 Linux 子系统,请以管理员身份打开 cmd.exe 并运行
DISM /Online /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux

关于powershell - Win10 : How to activate developer mode using powershell or cmd. exe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44158326/

相关文章:

powershell - 防止 PowerShell 在 PSObjects 中包装值类型

azure - Powershell 中使用 --runtime 命令设置 Jenkins 管道时出现的问题

windows - 如何读取 .txt 文件中的文本及其在 powershell 中的每个值?

windows - 在 UWP 应用程序中打开 UWP

powershell - 将Azure文件服务CloudFileShare映射为每个云服务实例上的虚拟目录

c - 如何在 Windows 上更新安装 GCC 11.2

cmd - 如何在 Windows 7 中永久自定义命令提示符的窗口大小/缓冲区大小?

c# - 媒体捕捉 : Photos have odd color letterboxing on Windows Phone

msbuild - Visual Studio 2015/Windows 10 SDK SignTool.exe 错误?

powershell - 如何在运行之前更新当前脚本?