小编Pap*_*oli的帖子

从批处理脚本中静默更改 Powershell 执行策略

我想要一些关于为 powershell 设置注册表值的帮助。路径是

[hkey_local_machine\system32\windows\microsoft\powershell\1\shellids\microsoft.powershell] "Path"="c:\windows\system32\windowspowershell\v1.0\powershell.exe" "ExecutionPolicy"="无限制"

因为我是从一台已知的好机器导入的,所以当我运行 .reg 文件时它工作正常。但我想在批处理文件中使用它。

当我手动调用命令提示符时,放入路径,例如c:\powershell.reg,这将导入值并根据需要覆盖注册表设置。
但是,如果我调用在批处理文件中执行相同的操作,则注册表中的值不会更改 在批处理文件中使用 reg add 命令,这些值不起作用。

powershell command-line

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

command-line ×1

powershell ×1