Click here to Skip to main content
15,915,160 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have exported registry values from one computer and i want to add same registry values to other computer. Usually if we double click .reg file it will add entire values directly.

But i want to add .reg file to the regedit through python script.

What I have tried:

Initially I thought I can just open .reg file like normal files and read. But how to add that file to regedit i am not understanding.

Can anyone provide me any ideas?
Thanks in advance
Posted
Updated 29-Apr-22 2:13am

Try a simple search: python registry - Google Search[^]
 
Share this answer
 
You can shell out to the REG command line tool to import the .REG file for you. Open a CMD prompt and type REG IMPORT /? for the command line options.

What you're doing, by exporting the registry on one machine and importing it on another, can make the machine you're importing on unbootable, depending on what you're importing.
 
Share this answer
 
Use REG. It won't take much time and it works.
 
Share this answer
 
Comments
Richard MacCutchan 30-Apr-22 11:11am    
What is "REG"? Please provide proper details in your answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900