-1

Need to save some reg file key data into a text file I can then manipulate. Trouble is regedit only saves as a .reg file even if you tell it save as text file. The resulting .reg file cannot be searched, grepped, or otherwise manipulated as text. Ideas ?

  • Did you try changing the extension to .txt? – Sam Forbis Feb 13 '20 at 00:45
  • reg files are indeed txt files with a different extension. You should be able to cat and grep them without issue. – SHawarden Feb 13 '20 at 00:55
  • I agree with the above, but Windows Search DOES find text in a .REG file. They can also be opened, edited and changed with a text editor using Open With. – John Feb 13 '20 at 01:15
  • 3
    @SHawarden+ .reg files are UTF-16 text. Many tools like grep don't handle that, at least not by default. But some things like notepad can convert them to UTF-8, or to 'ANSI' (Microsoft's version) if the data contains only 8-bit (or ASCII = 7-bit) chars. – dave_thompson_085 Feb 13 '20 at 02:05
  • @Johm: Have you "told' indexing options that .reg files are plain text? Control Panel (All Iems) > Indexing Options > Advanced > FIle Types. Select .reg & click Index Properties and File Contents. – Keith Miller Feb 13 '20 at 09:19
  • 1
    To all: changing the file extension has no effect on the file format. I'm searching the files with Linux, not Windows, Linux says the file format is MPEG ADTS. Saving as text from Notepad has no effect. Making changes in "indexing options" has no effect on existing file format, its just a file search option. I think this is another way Windows tries to keep its file type proprietary. I give up. – Bud Murf Feb 13 '20 at 18:32

2 Answers2

0

Use the command line: START /W REGEDIT /E file.txt %REG_PATH%

Credits to @npocmaka for original answer

0

in a .bat file (batch), use :

regedit /e info.txt "HKEY_CLASSES_ROOT*\shell\Windows.OpenWith"

replace HKEY_CLASSES_ROOT*\shell\Windows.OpenWith with your key

Or, got to control panel -> indexing options -> advanced, then click on more information about indexing, to learn how to add a new extension to the search engine.