Jump to content











Photo
- - - - -

Importing a string-type reg key which has a 'new-line'


  • Please log in to reply
5 replies to this topic

#1 gbrao

gbrao

    Frequent Member

  • Advanced user
  • 354 posts
  •  
    India

Posted 23 March 2013 - 08:53 AM

I would like to import a .reg file which adds a string-type subkey. The value has one line + 'newline' + second line.

 

I don't know how to do it.

 

'The Font Thing' creates a key of that type. If I export that key, delete the key from registry and then import the same file, it does nothing.

 

Screen shot with details :

http://i.imgur.com/vYCQmGJ.jpg

 

I've searched a lot, no solution. Note : I want to do it by importing a .reg file, not by any other means.

 

EDIT : I should have made this clear : I want the new-lines in the reg value to be preserved when it is added to the registry.



#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 23 March 2013 - 09:56 AM

your value does not look right - each line should be in   "xxx"="yyyy" format

 

I think you need to get rid of the carriage-returns, try

 

"001="asdfgqwertzxcvb"

 

 

Wht not use regedit to put the registry key in manually and the export it - that way you will have the correct format of file?



#3 gbrao

gbrao

    Frequent Member

  • Advanced user
  • 354 posts
  •  
    India

Posted 23 March 2013 - 10:08 AM

I want the new-line ( or CR or CR+LF ) to be preserved in the value added to the registry. That is the prob.

 

The file in the OP has been generated by exporting that key ( which has new-line ). The prob is there is no way to have a new-line 'character' in the string. I tried using /n, /r, /l - none worked.



#4 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 23 March 2013 - 10:28 AM

I don't think CR/LFs are allowed in string entries. If you try to make one in regedit, it just ignores the 0d 0a values - even if you edit the string in binary (hex), regedit simply ignores them.

 

If I try to export a modified string which has 00 0a and 00 0d in it, the exported string just ignores them.

 

 

try this format

 

 

"MULTILINETEXT"=hex(1):31,00,73,00,74,00,20,00,4c,00,69,00,6e,00,65,00,0d,00,0a,00,\
32,00,6e,00,64,00,20,00,4c,00,69,00,6e,00,65,00,0d,00,0a,00,\
00,00

 

make sure it ends with 00, 00  (for end of string)


  • gbrao and Motasem like this

#5 gbrao

gbrao

    Frequent Member

  • Advanced user
  • 354 posts
  •  
    India

Posted 23 March 2013 - 11:24 AM

Wow. Works. Thanks.



#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 6629 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 23 March 2013 - 11:26 AM

Yeah, I have infinite wisdom and knowledge  I used Google!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users