Saving registry (*.reg) files

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
necrosis
Posts: 3
Joined: Tue Jul 15, 2003 10:43 pm

Saving registry (*.reg) files

Post 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?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

In WinXP: Start->Run->regedit
In Regedit: File->Import
necrosis
Posts: 3
Joined: Tue Jul 15, 2003 10:43 pm

Post by necrosis »

That does not work either.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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
necrosis
Posts: 3
Joined: Tue Jul 15, 2003 10:43 pm

Post 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.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Do you have the correct settings for encoding and/or line ends?
geoffh
Posts: 2
Joined: Fri Aug 01, 2003 4:54 pm

Post 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.
geoffh
User avatar
bbadmin
Site Admin
Posts: 1022
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post 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
geoffh
Posts: 2
Joined: Fri Aug 01, 2003 4:54 pm

Post 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
geoffh
Post Reply