Page 1 of 1

Saving registry (*.reg) files

Posted: Tue Jul 15, 2003 10:45 pm
by necrosis
Whenever I save a *.reg file and then try to import it into the registry it gives me this error.
Cannot import <path to file>: The specified file is not a registry script. You can only import binary registry files from withen the registry editor.
Anyone know how to fix this?

Posted: Tue Jul 15, 2003 11:08 pm
by s_reynisson
In WinXP: Start->Run->regedit
In Regedit: File->Import

Posted: Fri Jul 18, 2003 8:42 pm
by necrosis
That does not work either.

Posted: Fri Jul 18, 2003 8:51 pm
by MudGuard
Where does the reg file come from?

Is it from the same version of windows as the windows version where you want to import it?
I know there was a slight change in file format between WinNT and Win2K

Posted: Fri Jul 18, 2003 10:37 pm
by necrosis
Well, im creating the code from scratch. If i create the file in notepad it works fine, tho if i create it in textpad i get the above error when i try to import it.

Posted: Fri Jul 18, 2003 10:43 pm
by MudGuard
Do you have the correct settings for encoding and/or line ends?

Posted: Fri Aug 01, 2003 4:58 pm
by geoffh
Apparently, when a file is exported from REGEDIT, a byte of hex "FF FE" is put at the beginning of the file. NOTEPAD also knows to add and keep this byte. TEXTPAD is stripping it off (and never adding it), so therein lies the problem I think. I have reported it in a Bug Report.

Posted: Sat Aug 02, 2003 7:33 am
by bbadmin
On Win2K/XP, registry files are Unicode, with a 2-byte BOM. To save files in that format with TextPad, check Write Unicode and UTF-8 BOM, for the appropriate (probably Default) document class.

The BOM is described here: http://www.unicode.org/unicode/faq/utf_bom.html

Keith MacDonald
Helios Software Solutions

Posted: Sat Aug 02, 2003 5:44 pm
by geoffh
Thanks, that was it!

I created a new *.REG Document Class, and checked "Write UNICODE and UTF-8 BOM", and checked "Default encoding = UTF-8".

Sorry about the premature Bug Report.

Geoff H