shell – New-Item递归注册表项
发布时间:2020-12-15 22:42:39 所属栏目:安全 来源:网络整理
导读:使用Power Shell,您可以运行这样的命令 ni c:/foo/bar -type directory 并且它将根据需要创建foo和bar.但是,如果你跑 ni hklm:software/classes/firefoxhtml/shell/edit/command -type directory 所有键,但最后一个必须存在或将生成错误. PowerShell可以根据
使用Power
Shell,您可以运行这样的命令
ni c:/foo/bar -type directory 并且它将根据需要创建foo和bar.但是,如果你跑 ni hklm:software/classes/firefoxhtml/shell/edit/command -type directory 所有键,但最后一个必须存在或将生成错误. PowerShell可以根据需要生成父密钥吗? 解决方法
我只是缺少-force参数
New-Item hklm:software/classes/firefoxhtml/shell/edit/command -Force 如果已经存在,使用-Force还将删除密钥下的所有内容,因此更好的选择 if(!(Test-Path $path)){ New-Item $path -Force; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |