/// <summary>
        /// 执行注册表导入
         /// </summary>
        /// <param name="regPath">注册表文件路径</param>
        public void ExecuteReg(string regPath)
        {
            if (File.Exists(regPath))
            {
                regPath = @"""" + regPath + @"""";
                Process.Start("regedit", string.Format(" /s {0}",regPath));
            }
        }

 

如果注册表路径含有空格,则需要使用双引号引起来,不然会报错。

/s:指示不弹出导入注册表对话框

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2021-11-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案