Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

I created and tried to import a .reg file but I received the error: Cannot import myfile.reg. The specified file is not a registry script. You can only import binary registry files from within the registry editor. So can any one suggest me, How to import .reg file into msconfig.
Thanks in Advance

Mohan G
Posted
Updated 28-Jul-13 23:34pm
v4
Comments
Andreas Gieriet 29-Jul-13 5:34am    
How did you create that myfile.reg?
Andi
Mohan Gopi 29-Jul-13 5:38am    
Hi Andi, Thanks for your replay. I am using following code [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun] "WindowsFormsApplication2"="/"C:\Program Files (x86)\Magna\Setup\WindowsFormsApplication2.exe""


Application Name : WindowsFormsApplication2
Installed Path : C:\Program Files (x86)\Magna\Setup\WindowsFormsApplication2.exe


the above code is written on Notepad and i saved as .reg. When i run this .reg file that time i got that error.
Richard MacCutchan 29-Jul-13 5:50am    
Your key is incorrect, and you are also missing the file header. Use regedit to export a small key and you will see how your file should be formatted.
[no name] 29-Jul-13 5:51am    
First of all, that is not "code".
Secondly, your error message means exactly what it says. Your text in your file is not the correct format for importing to the registry.

1 solution

Hi Mohan,

Try the below code in your application and just check it out ,

C#
Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true).SetValue(Application.ProductName, Application.ExecutablePath);


This code will register your application in msconfig . Hope this may help you a lot .:)
 
Share this answer
 
Comments
Mohan Gopi 1-Aug-13 6:39am    
Thanks for your reply Saravana. Its working fine.

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