How to do a batch file batch import registry key values?

tj_zero 65 Reputation points
2024-02-21T08:11:51.6766667+00:00

I want to write a batch file (.bat) to achieve subordinate functions: Batch import multiple registry key files (.reg) to meet system specific environment requirements; As it stands, I have two registry key files (a.reg and b.reg) that serve different functional purposes. How should I write batch files so that they can be imported to the target PC in bulk? I look forward to your guidance and help; Thank you;

Windows for business Windows Server User experience PowerShell
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. tj_zero 65 Reputation points
    2024-02-22T00:47:19.64+00:00

    I want to write a batch file (.bat) to achieve subordinate functions: Batch import multiple registry key files (.reg) to meet system specific environment requirements; As it stands, I have two registry key files (a.reg and b.reg) that serve different functional purposes. How should I write batch files so that they can be imported to the target PC in bulk? I look forward to your guidance and help; Thank you; Problem points for solving goals:

    1. Multiple registry key files (.reg format files) are stored in the specified path (such as: D:\Regfiles), write a batch file, to achieve one by one or concurrent import;
    2. How to solve the implementation of each imported action, the button dialog box automatically click to confirm; (Just look at the picture below.) It is estimated that a dialog box will pop up 3 times for each file import action, and you need to click "confirm" to continue normally. 3

    2

    1

    1. After completing all the set actions smoothly, the execution of the batch file is finished normally; (Can not pop window)
    0 comments No comments

  2. Anonymous
    2024-02-22T04:50:47.77+00:00

    Hi tj_zero,

    You can import the registry files using the reg import command.

    reg import E:\path\of\file1.reg
    reg import E:\path\of\file2.reg
    

    https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg-import

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.