Windows Registry Carriage Return

Posted on 2004-11-03
Last Modified: 2008-01-09
I have Win Xp machines as well some Win NT4 machines and I am trying to add carriage returns into the legalnoticetext.
On the XP machine I did a search and came up with a post that says for Win2k to edit the registry setting in binary and add
"0D000A00" however when doing so i simply get small boxes displayed.

There is obviously something i am doing wrong, is this different for XP or perhaps im just incorrectly adding it in. Can someone add some insight to this, possibly post an example?

Thanks in advance!

Question by:mklaro
    LVL 95

    Expert Comment

    by:Lee W, MVP
    Typically, you need a carriage return + line feed in Windows.  Not sure it will work, but you could try adding the Line Feed.  When editing the registry.  Sorry I can't help beyond that.

    Author Comment

    what would the entry be to add a line feed, im stumped with this...
    LVL 3

    Expert Comment

    Add a space to the end of your text, then type 0D000A00. The hex 0D (decimal 13) is a carriage return. The hex 0A (decimal 10) is a line feed.
    LVL 10

    Accepted Solution


    each character have two pairs of values (space bar = 20 00)
    you need to add 0D000A00 AFTER the 20 00
    ie in Binary mode as explained in this link for the text "Line1Line2"

    0000 4C 00 69 00 6E 00 65 00 L.i.n.e.
    0008 31 00 4C 00 69 00 6E 00 1.L.i.n.
    0010 65 00 32 00 00 00          e.2...

    Compare the binary on the left and the text on the right :
    The 1 of Line1 is 31 00
    So add 0D000A00 after 31 00
    it becomes 31 00 0D 00 0A 00
    One carriage after Line2 wher 2 is 32 00
    It becomes 32 00 0D 00 0A 00

    Author Comment

    i got it thanks everyone
    LVL 10

    Expert Comment

    Dim WshShell, bKey
    Set WshShell = WScript.CreateObject("WScript.Shell")

    Title = "Title name"
    Text = "Ligne0" & VbCrLf & "Ligne1" & VbCrLf & "Ligne2"

    WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeCaption", Title, "REG_SZ"
    WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeText", Text, "REG_SZ"

    bkey = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeCaption")
    bkey = bkey & VbCrLf & VbCrLf & WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeText")

    WScript.Echo bkey

    To automate the procedure on more computers you can put the above lines in a .vbs file.
    Change the values between quotes in these two lines :
    Title = "Title name"
    Text = "Line0" & VbCrLf & "Line1" & VbCrLf & "Line2"

    The three last lines of the script are just there to display the result.
    You can delete them.

    VbCrLf is the Carriage Return (0D000A00)

    For NT machines you need "Windows Script 5.6 for Windows 98, Windows Millennium Edition, and Windows NT 4.0" :

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
    Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now