我有一组 .reg
文件需要通过 puppet 导入。我看到了 puppetlabs 注册表模块,但无法导入 .reg
文件。有没有办法通过 puppet 静默导入 .reg
文件?
最佳答案
regedit.exe
有一个 switch /s
用于静默导入注册表文件。通过 exec
resource 导入文件.
$file = 'C:\path\to\your.reg'
exec { "import $file":
command => "regedit.exe /s $file",
require => File[$file],
}
或者您可以使用 reg.exe
命令行实用程序,正如@AlexK 在评论中所建议的那样:
$file = 'C:\path\to\your.reg'
exec { "import $file":
command => "reg.exe import $file",
require => File[$file],
}
关于windows - 通过 puppet 模块导入注册表文件的静默方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39544548/