WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sample Code from Users

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Registry Script Generator

 Keywords: REG2WBT WinBatch script create WBT REGEDIT4  REGEDIT5 .REG exported registry

;==========================================================================================================================================
; REG2WBT.wbt  v1.04  20051202                                                                                    (c)20030905.Detlev Dalitz
;==========================================================================================================================================


;------------------------------------------------------------------------------------------------------------------------------------------
; This WinBatch script will create a WinBatch scriptfile,
; based on a REGEDIT4 or REGEDIT5 textfile exported from the Windows registry.
;
; See examples at bottom of this file.
;
; This WinBatch script is heavily based on the fundamental work by Brad Sjue,
; who has created his first Reg2Wbt converter script at September 02, 2003,
; and has published it in WinBatch forum.
;
; Brad Sjue's code work gave me the final push to fullfil my own work,
; which I have started prior about one month before, when someone has requested
; those new application in the WinBatch forum.
;------------------------------------------------------------------------------------------------------------------------------------------
; Changes in Version 1.04
; - Can now handle registry files of Version 4 and 5.
; - Can now handle one long line of binary hex values by converting into wrapped lines.
; - Added a second security question into the generated script about to proceed restore registry values.
;------------------------------------------------------------------------------------------------------------------------------------------
;
; ==>  In order to have a safe testcase it is recommended  ...      <==
; ==>  ... to run the additional script "PrepareTest.REG2WBT.wbt".  <==
;
;------------------------------------------------------------------------------------------------------------------------------------------


;--------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfFileGetLineCount (sFilename)
iBBSize = FileSizeEx (sFilename)
If !iBBSize Then Return (0)
hBB = BinaryAlloc (iBBSize)
iHigh = BinaryRead (hBB, sFilename) - 1
While (@CR == BinaryPeekStr (hBB, iHigh, 1))
   iHigh = iHigh - 1
EndWhile
iLineCount = BinaryStrCnt (hBB, 0, iHigh, @LF)
iLineCount = iLineCount + (@LF <> BinaryPeekStr (hBB, iHigh, 1))
BinaryFree (hBB)
Return (iLineCount)
;..........................................................................................................................................
; This function "udfFileGetLineCount" returns the number of lines counted in a textfile.
; This function takes only @LF characters into account.
; All @CR characters are ommitted.
; The function provides the same number of lines as counted by the WIL standard FileRead function.
; Detlev Dalitz.20020820
;..........................................................................................................................................
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfHexToDec (sHex)
sHexChars = "0123456789ABCDEF"
sHex = StrUpper (StrTrim (sHex))
iHigh = StrLen (sHex)
iDec = 0
For ii = 1 To iHigh
   iDec = (iDec << 4) + StrIndex (sHexChars, StrSub (sHex, ii, 1), 0, @FWDSCAN) - 1
Next
Return (iDec)
; Note: Returned negative numbers are ok for use in WinBatch.
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfCreateSafeTextTable ()
sSafeChars = " !""#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
sReplaceChar = "."
hBB = BinaryAlloc (256) ; The buffer, especially hBB[0], is already initialized by value 0.
For ii = 1 To 255
   BinaryPoke (hBB, ii, ii)
Next
BinaryPokeStr (hBB, 0, sReplaceChar)
BinaryPokeStr (hBB, 1, StrClean (BinaryPeekStr (hBB, 1, 255), sSafeChars, sReplaceChar, @TRUE, 2))
Return (hBB)
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineSubRoutine udsConvertHexToSafeText (hBBSafe, hBBHex, sHex)
BinaryEodSet (hBBHex, 0)
BinaryPokeHex (hBBHex, 0, sHex)
Return (BinaryPeekStr (hBBHex, 0, BinaryXlate (hBBHex, hBBSafe, 0)))
#EndSubRoutine
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineSubRoutine udsStrEscape (sString)
Return (StrReplace (StrReplace (StrReplace (StrReplace (sString, '\"', '"'), '\\', '\'), '%%', '%%%%'), '`', '``'))
#EndSubRoutine
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineSubRoutine udsPosEq (sString)
Return (StrIndex (StrClean (StrReplace (sString, '\"', "  "), '"=', " ", @TRUE, 2), ' "=', 1, @FWDSCAN) + 2)
#EndSubRoutine
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfReturnSub (a, b)
Return (a)
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineSubRoutine udsAskFilenameReg (AF_default)
AF_folder = FilePath (AF_default)
If !DirExist (AF_folder) Then AF_folder = IniReadPvt (sAppProductName, "Reg_Folder", "", sAppIni)
If !DirExist (AF_folder) Then AF_folder = Environment ("temp")
If !DirExist (AF_folder) Then AF_folder = ShortCutDir ("Desktop", 0, @TRUE)
If (AF_default == "") Then AF_default = IniReadPvt (sAppProductName, "Reg_File", "", sAppIni)
If (AF_default == "") Then AF_default = "*.reg"
AF_title = sAppProductName : ": Select Registry File to convert to Winbatch ..."
AF_filetypes = "Reg Files|*.reg|Wbt Files|*.wbt|Reg & Wbt Files|*.wbt;*.reg|All Files|*.*|"
AF_flag = 1  ; Open single file.
AF_file = AskFilename (AF_title, AF_folder, AF_filetypes, AF_default, AF_flag)
If FileExist (AF_file) Then AF_file = FileNameLong (StrUpper (AF_file))
AF_folder = FilePath (AF_file)
IniWritePvt (sAppProductName, "Reg_Folder", AF_folder, sAppIni)
IniWritePvt (sAppProductName, "Reg_File", AF_file, sAppIni)
IniWritePvt ("", "", "", sAppIni)
Return (udfReturnSub (AF_file, DropWild ("AF_*")))
#EndSubRoutine
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineSubRoutine udsAskFilenameWbt (AF_default)
AF_folder = FilePath (AF_default)
If !DirExist (AF_folder) Then AF_folder = IniReadPvt (sAppProductName, "Wbt_Folder", "", sAppIni)
If !DirExist (AF_folder) Then AF_folder = Environment ("temp")
If !DirExist (AF_folder) Then AF_folder = ShortCutDir ("Desktop", 0, @TRUE)
If (AF_default == "") Then AF_default = IniReadPvt (sAppProductName, "Wbt_File", "", sAppIni)
If (AF_default == "") Then AF_default = "*.wbt"
AF_title = sAppProductName : ": Save WinBatch file as ..."
AF_filetypes = "Wbt Files|*.wbt|Reg Files|*.reg|Reg & Wbt Files|*.wbt;*.reg|All Files|*.*|"
AF_flag = 0 ; Save style
AF_file = AskFilename (AF_title, AF_folder, AF_filetypes, AF_default, AF_flag)
If FileExist (AF_file) Then AF_file = FileNameLong (StrUpper (AF_file))
AF_folder = FilePath (AF_file)
IniWritePvt (sAppProductName, "Wbt_Folder", AF_folder, sAppIni)
IniWritePvt (sAppProductName, "Wbt_File", AF_file, sAppIni)
IniWritePvt ("", "", "", sAppIni)
Return (udfReturnSub (AF_file, DropWild ("AF_*")))
#EndSubRoutine
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfMsgBox (sCaption, sText, iFlags)
Return (DllCall (DirWindows (1) : "User32.dll", long : "MessageBoxA", long : DllHwnd (""), lpstr : sText, lpstr : sCaption, long : iFlags))
;..........................................................................................................................................
;+-----STYLE-----------------------+-----ICONS-----------------------+
;| OK               = 0            | STOP      = 16                  |
;| OKCANCEL         = 1            | QUESTION  = 32                  |
;| ABORTRETRYIGNORE = 2            | EXCLAIM   = 48                  |
;| YESNOCANCEL      = 3            | INFO      = 64                  |
;| YESNO            = 4            | WINICON   = 4096                |
;| RETRYCANCEL      = 5            |                                 |
;+-----BUTTONS---------------------|----RETURN VALUES----------------|
;| DEFAULTBUTTON1   = 0            | IDOK      = 1                   |
;| DEFAULTBUTTON2   = 256          | IDCANCEL  = 2                   |
;| DEFAULTBUTTON3   = 512          | IDABORT   = 3                   |
;+---------------------------------| IDRETRY   = 4                   |
;| Combine flags with OR operator: | IDIGNORE  = 5                   |
;|      Flags=4|48|256|4096        | IDYES     = 6                   |
;|                                 | IDNO      = 7                   |
;+---------------------------------+---------------------------------+
;From:  MWorrel mworrel@yahoo.com
;Date:  Friday, September 12, 2003 08:54 AM
;..........................................................................................................................................
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------




;------------------------------------------------------------------------------------------------------------------------------------------
; Main
;------------------------------------------------------------------------------------------------------------------------------------------
sAppProductName = "REG2WBT"
sAppProductVersion = "1"
sAppFileVersion = "1.04"
sAppFileVersionDate = "20051202"
sAppDescription = "Conversion from Registry exportfile (reg) to WinBatch scriptfile (wbt)"
sAppCopyright = "(c)20030905 Detlev Dalitz"
;..........................................................................................................................................
sAppFolder = FilePath (IntControl (1004, 0, 0, 0, 0))
sAppIni = sAppFolder : sAppProductName : ".ini"
;..........................................................................................................................................
IniWritePvt (sAppProductName, "ProductName", sAppProductName, sAppIni)
IniWritePvt (sAppProductName, "FileVersion", sAppFileVersion, sAppIni)
IniWritePvt (sAppProductName, "FileVersionDate", sAppFileVersionDate, sAppIni)
IniWritePvt (sAppProductName, "FileDescription", sAppDescription, sAppIni)
IniWritePvt (sAppProductName, "ProductVersion", sAppProductVersion, sAppIni)
IniWritePvt (sAppProductName, "LegalCopyright", sAppCopyright, sAppIni)
;..........................................................................................................................................
sMsgError = sAppProductName : ": Error"
sMsgWarning = sAppProductName : ": Warning"
;..........................................................................................................................................
; Find the registry file to be converted.
sFileReg = udsAskFilenameReg ("")
; Find a place to store the WinBatch file to be created.
sFileWbt = FilePath (sFileReg) : FileBaseName (sFileReg) : ".to.wbt"
sFileWbt = udsAskFilenameWbt (sFileWbt)
;..........................................................................................................................................
iFileRegSize = FileSizeEx (sFileReg)
sFileRegYmdHms = FileYmdHms (sFileReg)
iFileRegLines = udfFileGetLineCount (sFileReg)
;..........................................................................................................................................
iLastErrorMode = ErrorMode (@OFF)
hFW = FileOpen (sFileWbt, "Write")
ErrorMode (iLastErrorMode)
sMsgText = "Cannot open WBT output file:" : @LF : sFileWbt
Terminate (!hFW, sMsgError, sMsgText)
;..........................................................................................................................................
sYmdHmsStart = TimeYmdHms ()
;..........................................................................................................................................
sMsgTitle = sAppProductName : ": " : sAppDescription
sMsgText = "Processing ..."
BoxOpen (sMsgTitle, sMsgText)
WinPlace (100, 250, 900, 370, "")
;..........................................................................................................................................
sHKCR = "HKEY_CLASSES_ROOT"
sHKLM = "HKEY_LOCAL_MACHINE"
sHKCU = "HKEY_CURRENT_USER"
sHKU = "HKEY_USERS"
sKeyHKCR = "@REGCLASSES"
sKeyHKLM = "@REGMACHINE"
sKeyHKCU = "@REGCURRENT"
sKeyHKU = "@REGUSERS"

sRegCreateKeyMask = "If !RegExistKey({1},sSubKey)" : @CRLF : "   RegCreateKey({1},sSubKey)" : @CRLF : "EndIf"
sRegSetBinMask = "RegSetBin({1},StrCat(sSubKey,`[{3}]`),sBinData)"
sRegSetDwordMask = "RegSetDword({1},StrCat(sSubKey,`[{3}]`),{4})"
sRegSetExpSzMask = "RegSetExpSz({1},StrCat(sSubKey,`[{3}]`),sExpSzData)"
sRegSetMulSzMask = "RegSetMulSz({1},StrCat(sSubKey,`[{3}]`),sMulSzData,sSzDelim)"
sRegSetValueMask = "RegSetValue({1},StrCat(sSubKey,`[{3}]`),`{4}`)"
sRegSetValueMask2 = "RegSetValue({1},StrCat(sSubKey,`[{3}]`),sStrData)"

sBinDataMask = "sBinData = StrCat(sBinData,`{1}`){2} ; [{3}]"
sBinDataMask1 = "sBinData = ``"
sExpSzDataMask = "sExpSzData = StrCat(sExpSzData,`{1}`){2} ; [{3}]"
sExpSzDataMask1 = "sExpSzData = ``"
sMulSzDataMask = "sMulSzData = StrCat(sMulSzData,`{1}`){2} ; [{3}]"
sMulSzDataMask1 = "sMulSzData = ``"
sStrDataMask = "sStrData = StrCat(sStrData,`{1}`)"
sStrDataMask1 = "sStrData = ``"
sSubKeyMask = "sSubKey = ItemInsert(`{1}`,-1,sSubKey,`\`)"
sSubKeyMask1 = "sSubKey = ``"
sHKeyMask = "sHKey = `{1}`"

sKeyLinePattern = @LF : '[*]' : @LF
sBinLinePattern = @LF : '"*"=hex:*' : @LF
sExpSzLinePattern = @LF : '"*"=hex(2):*' : @LF
sMulSzLinePattern = @LF : '"*"=hex(7):*' : @LF
sDwordLinePattern = @LF : '"*"=dword:*' : @LF
sStrLinePattern1 = '@='
sStrLinePattern2 = @LF : '"*"="*"' : @LF

sLitBin = "hex:"
sLitDword = "dword:"
sLitHex2 = "hex(2):"
sLitHex7 = "hex(7):"

sMsgTextMask = "# {1}/{2}" : @LF : "{3} ..."

@P1 = "{1}"
@P2 = "{2}"
@P3 = "{3}"
@P4 = "{4}"
@P5 = "{5}"

@C0 = ""
@C32 = " "
@C44 = ","
@C59 = ";"
@C92 = "\"
@EOF = "*EOF*"
@REGEDIT4 = "REGEDIT4"
;@REGEDIT5 = "ÿþWindows Registry Editor Version 5.00" ; First two chars are the unicode marker. Note: FileRead reads unicode as normal text.
@REGEDIT5 = "Windows Registry Editor Version 5.00" ; Note: FileRead reads unicode as normal text.



sFuncGetSzDelim = "sSzDelim = udfGetSzDelim(sMulSzData)"
sFuncConvertExpSz = "sExpSzData = udfConvertHexReg(sExpSzData,``)"
sFuncConvertMulSz = "sMulSzData = udfConvertHexReg(sMulSzData,sSzDelim)"
sFuncBoxText = "BoxText(StrReplace(StrCat(sHKey,`\`,sSubKey),`\`,StrCat(`\`,@LF)))"

hBBSafe = udfCreateSafeTextTable () ; Buffer for xlating hexstrings.
hBBHex = BinaryAlloc (30)           ; Buffer for xlating hexstrings.

iStrDataChunk = 75

;..........................................................................................................................................
sMsgTextMask = StrReplace (sMsgTextMask, @P1, iFileRegLines)
;..........................................................................................................................................
sMsgTitle = sMsgTitle : " - " : FileBaseName (sFileReg)
BoxTitle (sMsgTitle)
sMsgText = "Writing header ..."
BoxText (sMsgText)
;..........................................................................................................................................
sRuler = @C59 : StrFill ("-", 140)
FileWrite (hFW, sRuler)
FileWrite (hFW, `; This WinBatch script has been auto-generated by ` : sAppProductName : ` ` : sAppFileVersion : ` ` : sAppCopyright)
FileWrite (hFW, sRuler)
FileWrite (hFW, `; Reg origin  : ` : sFileReg)
FileWrite (hFW, `; Reg created : ` : sFileRegYmdHms)
FileWrite (hFW, `; Reg lines   : ` : iFileRegLines)
FileWrite (hFW, sRuler)
FileWrite (hFW, `; Wbt opened  : ` : sYmdHmsStart)
FileWrite (hFW, sRuler)
FileWrite (hFW, ``)
FileWrite (hFW, ``)
FileWrite (hFW, `sFilename = IntControl(1004,0,0,0,0)`)
FileWrite (hFW, `sMsgTitle = "Import data into Windows Registry"`)
FileWrite (hFW, `sMsgText = StrCat(sFilename,@LF,"Do you want to process this file",@LF,"and overwrite existing values in the Registry?")`)
FileWrite (hFW, `Pause(sMsgTitle,sMsgText)`)
FileWrite (hFW, `sMsgText = StrCat(sFilename,@LF,"ARE YOU REALLY SURE to process this file",@LF,"and overwrite existing values in the Registry?")`)
FileWrite (hFW, `Pause(sMsgTitle,sMsgText)`)
FileWrite (hFW, ``)
FileWrite (hFW, ``)
FileWrite (hFW, sRuler)
FileWrite (hFW, `#DefineFunction udfGetDelimiter (sString)               `)
FileWrite (hFW, `; Search #1.                                            `)
FileWrite (hFW, `If !StrIndex(sString,@TAB,1,@FWDSCAN) Then Return (@TAB)`)
FileWrite (hFW, `; Search #2.                                            `)
FileWrite (hFW, `If !StrIndex(sString,@LF,1,@FWDSCAN) Then Return (@LF)  `)
FileWrite (hFW, `; Search #3.                                            `)
FileWrite (hFW, `If !StrIndex(sString,@CR,1,@FWDSCAN) Then Return (@CR)  `)
FileWrite (hFW, `; Search #4.                                            `)
FileWrite (hFW, `sTable = "|#:;,./\!?=_-+*^~()[]{}<>&@$ "                `)
FileWrite (hFW, `sTable = StrClean(sTable,sString,"",@TRUE,1)            `)
FileWrite (hFW, `If (StrLen(sTable)>1) Then Return (StrSub(sTable,1,1))  `)
FileWrite (hFW, `; Search #5.                                            `)
FileWrite (hFW, `For i=255 To 1 By -1                                    `)
FileWrite (hFW, `   sTable = StrCat(sTable,Num2Char(i))                  `)
FileWrite (hFW, `Next                                                    `)
FileWrite (hFW, `sTable = StrClean(sTable,sString,"",@TRUE,1)            `)
FileWrite (hFW, `If (StrLen(sTable)>1) Then Return (StrSub(sTable,1,1))  `)
FileWrite (hFW, `; No delimiters available.                              `)
FileWrite (hFW, `Return ("")                                             `)
FileWrite (hFW, `#EndFunction                                            `)
FileWrite (hFW, sRuler)
FileWrite (hFW, ``)
FileWrite (hFW, ``)
FileWrite (hFW, sRuler)
FileWrite (hFW, `#DefineFunction udfGetSzDelim (sSzData)                                         `)
FileWrite (hFW, `sSzData = StrReplace(StrReplace(sSzData,"00","")," ","")                        `)
FileWrite (hFW, `If (sSzData>"")                                                                 `)
FileWrite (hFW, `   hBB = BinaryAlloc(StrLen(sSzData)/2)                                         `)
FileWrite (hFW, `   sSzDelim = udfGetDelimiter(BinaryPeekStr(hBB,0,BinaryPokeHex(hBB,0,sSzData)))`)
FileWrite (hFW, `   BinaryFree(hBB)                                                              `)
FileWrite (hFW, `Else                                                                            `)
FileWrite (hFW, `   sSzDelim = IntControl(29,"",0,0,0)                                           `)
FileWrite (hFW, `EndIf                                                                           `)
FileWrite (hFW, `Return (sSzDelim)                                                               `)
FileWrite (hFW, `#EndFunction                                                                    `)
FileWrite (hFW, sRuler)
FileWrite (hFW, ``)
FileWrite (hFW, ``)
FileWrite (hFW, sRuler)
FileWrite (hFW, `#DefineFunction udfConvertHexReg (sRegValue, sSzDelim)               `)
FileWrite (hFW, `If (sRegValue=="") Then Return ("")                                  `)
FileWrite (hFW, `If (sSzDelim>"") Then sSzDelim = StrSub(sSzDelim,1,1)                `)
FileWrite (hFW, `   Else sSzDelim = IntControl(29,"",0,0,0)                           `)
FileWrite (hFW, `hBB = BinaryAlloc(StrLen(sRegValue))                                 `)
FileWrite (hFW, `BinaryPokeStr(hBB,0,sSzDelim)                                        `)
FileWrite (hFW, `sSzDelimHex = BinaryPeekHex(hBB,0,1)                                 `)
FileWrite (hFW, `sRegValue = StrReplace(StrReplace(sRegValue,"00",sSzDelimHex)," ","")`)
FileWrite (hFW, `iEod = BinaryPokeHex(hBB,0,sRegValue)-1                              `)
FileWrite (hFW, `While (BinaryPeekStr(hBB,iEod,1)==sSzDelim)                          `)
FileWrite (hFW, `   iEod = iEod-1                                                     `)
FileWrite (hFW, `   If (iEod<0) Then Break                                            `)
FileWrite (hFW, `EndWhile                                                             `)
FileWrite (hFW, `sSzValue = BinaryPeekStr(hBB,0,iEod+1)                               `)
FileWrite (hFW, `BinaryFree(hBB)                                                      `)
FileWrite (hFW, `Return (sSzValue)                                                    `)
FileWrite (hFW, `#EndFunction                                                         `)
FileWrite (hFW, sRuler)
FileWrite (hFW, ``)
FileWrite (hFW, ``)
FileWrite (hFW, sRuler)
FileWrite (hFW, `; Registration Database Operations`)
FileWrite (hFW, sRuler)
FileWrite (hFW, `BoxOpen("Writing to Registry on Key ...","")`)
FileWrite (hFW, `WinPlace(100,100,500,500,"")`)
FileWrite (hFW, ``)
;..........................................................................................................................................
IntControl (65, 4096 * 64, 0, 0, 0) ; Set size of internal FileRead buffer.
hFR = FileOpen (sFileReg, "READ")
;..........................................................................................................................................
iLine = 0
While @TRUE
   sLine = FileRead (hFR)
   If (sLine == @EOF) Then Break
   iLine = iLine + 1
   sLine = StrTrim (sLine)
   If (sLine == @REGEDIT4) Then Break
   If (sLine == @REGEDIT5) Then Break
EndWhile
sMsgText = "Read error input file."
Terminate (sLine == @EOF, sMsgError, sMsgText)
Terminate ((sLine != @REGEDIT4) && (sLine != @REGEDIT5), sMsgError, sMsgText)

While @TRUE
   sLine = FileRead (hFR)
   If (sLine == @EOF) Then Break
   iLine = iLine + 1
   sLine = StrTrim (sLine)
   If (StrSub (sLine, 1, 1) == @C59) Then Continue
   If !(iLine mod 10) Then BoxText (StrReplace (StrReplace (sMsgTextMask, @P2, iLine), @P3, StrSub (sLine, 1, 100)))

   Switch @TRUE
   Case (sLine == @C0)
      FileWrite (hFW, @C0)
      Break

   Case @TRUE
      sTestLine = @LF : sLine : @LF
      Continue

      ; --- HKEY ---
   Case (StrIndexWild (sTestLine, sKeyLinePattern, 1) == 1)
      sLine = StrSub (sLine, 2, StrLen (sLine) - 2)
      sHKey = ItemExtract (1, sLine, @C92)
      Switch @TRUE
      Case !StriCmp (sHKey, sHKCR)
         sRegHandle = sKeyHKCR
         Break
      Case !StriCmp (sHKey, sHKLM)
         sRegHandle = sKeyHKLM
         Break
      Case !StriCmp (sHKey, sHKCU)
         sRegHandle = sKeyHKCU
         Break
      Case !StriCmp (sHKey, sHKU)
         sRegHandle = sKeyHKU
         Break
      EndSwitch

      FileWrite (hFW, StrReplace (sHKeyMask, @P1, sHKey))
      FileWrite (hFW, sSubKeyMask1)

      sCreateSubKey = ItemRemove (1, sLine, @C92)
      iCount = ItemCount (sCreateSubKey, @C92)
      For ii = 1 To iCount
         sSubKey = StrReplace (sSubKeyMask, @P1, udsStrEscape (ItemExtract (ii, sCreateSubKey, @C92)))
         FileWrite (hFW, sSubKey)
      Next

      FileWrite (hFW, sFuncBoxText)
      FileWrite (hFW, StrReplace (sRegCreateKeyMask, @P1, sRegHandle))
      Break

      ; --- REG_BINARY ---
   Case (StrIndexWild (sTestLine, sBinLinePattern, 1) == 1)
      FileWrite (hFW, sBinDataMask1)

      iPosEq = udsPosEq (sLine)

      ; Get String Value.
      sValue = StrSub (sLine, 2, iPosEq - 3)
      sValue = udsStrEscape (sValue)

      ; Get Bin Data.
      sData = StrSub (sLine, iPosEq + 1, -1)
      sData = StrReplace (sData, sLitBin, @C0)

      Switch @TRUE
      Case (ItemCount (sData, @C44) > 25)
         ; Handle single long line.
         sDataTemp = ""
         While (sData > "")
            sDataTemp = ItemInsert (StrSub (sData, 1, 75), -1, sDataTemp, @C92)
            sData = StrSub (sData, 76, -1)
         EndWhile
         While @TRUE
            sData = ItemExtract (1, sDataTemp, @C92)
            sComment = udsConvertHexToSafeText (hBBSafe, hBBHex, StrReplace (sData, @C44, @C0))
            sData = StrReplace (sData, @C44, @C32)
            sFiller = StrFill (@C32, 4 + 75 - StrLen (sData))
            sDataNew = StrReplace (StrReplace (StrReplace (sBinDataMask, @P1, sData), @P2, sFiller), @P3, sComment)
            FileWrite (hFW, sDataNew)
            sDataTemp = ItemRemove (1, sDataTemp, @C92)
            If (sDataTemp == "") Then Break
         EndWhile
         Break
      Case (ItemCount (sData, @C44) > 0)
         ; Extract each line from file.
         While @TRUE
            sData = ItemExtract (1, sData, @C92)
            sComment = udsConvertHexToSafeText (hBBSafe, hBBHex, StrReplace (sData, @C44, @C0))
            sData = StrReplace (sData, @C44, @C32)
            sFiller = StrFill (@C32, 4 + 75 - StrLen (sData))
            sDataNew = StrReplace (StrReplace (StrReplace (sBinDataMask, @P1, sData), @P2, sFiller), @P3, sComment)
            FileWrite (hFW, sDataNew)
            If (StrSub (sLine, StrLen (sLine), 1) != @C92) Then Break
            sLine = FileRead (hFR)
            If (sLine == @EOF) Then Break
            iLine = iLine + 1
            sLine = StrTrim (sLine)
            If (StrSub (sLine, 1, 1) == @C59) Then Continue
            If !(iLine mod 10) Then BoxText (StrReplace (StrReplace (sMsgTextMask, @P2, iLine), @P3, sLine))
            sData = sLine
         EndWhile
         Break
      EndSwitch

      FileWrite (hFW, StrReplace (StrReplace (StrReplace (sRegSetBinMask, @P1, sRegHandle), @P2, sCreateSubKey), @P3, sValue))
      Break

      ; --- REG_EXPAND_SZ ---
   Case (StrIndexWild (sTestLine, sExpSzLinePattern, 1) == 1)
      FileWrite (hFW, sExpSzDataMask1)

      iPosEq = udsPosEq (sLine)

      ; Get String Value.
      sValue = StrSub (sLine, 2, iPosEq - 3)
      sValue = udsStrEscape (sValue)

      ; Get Bin Data.
      sData = StrSub (sLine, iPosEq + 1, -1)
      sData = StrReplace (sData, sLitHex2, @C0)

      ; Extract each line.
      If ItemCount (sData, @C44)
         While @TRUE
            sData = ItemExtract (1, sData, @C92)
            sComment = udsConvertHexToSafeText (hBBSafe, hBBHex, StrReplace (sData, @C44, @C0))
            sData = StrReplace (sData, @C44, @C32)
            sFiller = StrFill (@C32, 75 - StrLen (sData))
            sDataNew = StrReplace (StrReplace (StrReplace (sExpSzDataMask, @P1, sData), @P2, sFiller), @P3, sComment)
            FileWrite (hFW, sDataNew)
            If (StrSub (sLine, StrLen (sLine), 1) != @C92) Then Break
            sLine = FileRead (hFR)
            If (sLine == @EOF) Then Break
            iLine = iLine + 1
            sLine = StrTrim (sLine)
            If (StrSub (sLine, 1, 1) == @C59) Then Continue
            If !(iLine mod 10) Then BoxText (StrReplace (StrReplace (sMsgTextMask, @P2, iLine), @P3, sLine))
            sData = sLine
         EndWhile
      EndIf

      FileWrite (hFW, sFuncConvertExpSz)
      FileWrite (hFW, StrReplace (StrReplace (StrReplace (sRegSetExpSzMask, @P1, sRegHandle), @P2, sCreateSubKey), @P3, sValue))
      Break

      ; --- REG_MULTI_SZ ---
   Case (StrIndexWild (sTestLine, sMulSzLinePattern, 1) == 1)
      FileWrite (hFW, sMulSzDataMask1)

      iPosEq = udsPosEq (sLine)

      ; Get String Value.
      sValue = StrSub (sLine, 2, iPosEq - 3)
      sValue = udsStrEscape (sValue)

      ; Get Bin Data.
      sData = StrSub (sLine, iPosEq + 1, -1)
      sData = StrReplace (sData, sLitHex7, @C0)

      ; Extract each line.
      If ItemCount (sData, @C44)
         While @TRUE
            sData = ItemExtract (1, sData, @C92)
            sComment = udsConvertHexToSafeText (hBBSafe, hBBHex, StrReplace (sData, @C44, @C0))
            sData = StrReplace (sData, @C44, @C32)
            sFiller = StrFill (@C32, 75 - StrLen (sData))
            sDataNew = StrReplace (StrReplace (StrReplace (sMulSzDataMask, @P1, sData), @P2, sFiller), @P3, sComment)
            FileWrite (hFW, sDataNew)
            If (StrSub (sLine, StrLen (sLine), 1) != @C92) Then Break
            sLine = FileRead (hFR)
            If (sLine == @EOF) Then Break
            iLine = iLine + 1
            sLine = StrTrim (sLine)
            If (StrSub (sLine, 1, 1) == @C59) Then Continue
            If !(iLine mod 10) Then BoxText (StrReplace (StrReplace (sMsgTextMask, @P2, iLine), @P3, sLine))
            sData = sLine
         EndWhile
      EndIf

      FileWrite (hFW, sFuncGetSzDelim)
      FileWrite (hFW, sFuncConvertMulSz)
      FileWrite (hFW, StrReplace (StrReplace (StrReplace (sRegSetMulSzMask, @P1, sRegHandle), @P2, sCreateSubKey), @P3, sValue))
      Break

      ; --- REG_DWORD ---
   Case (StrIndexWild (sTestLine, sDwordLinePattern, 1) == 1)
      iPosEq = udsPosEq (sLine)

      ; Get String Value.
      sValue = StrSub (sLine, 2, iPosEq - 3)
      sValue = udsStrEscape (sValue)

      ; Get Dword Data.
      sData = StrSub (sLine, iPosEq + 1, -1)
      sData = StrReplace (sData, sLitDword, @C0)

      sData = udfHexToDec (sData)
      FileWrite (hFW, StrReplace (StrReplace (StrReplace (sRegSetDwordMask, @P1, sRegHandle), @P3, sValue), @P4, sData))
      Break

      ; --- REG_SZ string ---
   Case (StrIndex (sLine, sStrLinePattern1, 1, @FWDSCAN) == 1)
      sValue = @C0
      iPosEq = 2
      Continue
   Case (StrIndexWild (sTestLine, sStrLinePattern2, 1) == 1)
      iPosEq = udsPosEq (sLine)

      ; Get String Value.
      sValue = StrSub (sLine, 2, iPosEq - 3)
      sValue = udsStrEscape (sValue)
      Continue
   Case @TRUE
      ; Get String Data.
      sData = StrSub (sLine, iPosEq + 1, -1)
      sData = StrSub (sData, 2, StrLen (sData) - 2)

      If (StrLen (sData) > iStrDataChunk)
         FileWrite (hFW, sStrDataMask1)
         ; Break before backslash.
         While (sData > @C0)
            iPos = iStrDataChunk
            While (StrSub (sData, iPos, 1) == @C92)
               iPos = iPos - 1
               If (iPos < 1) Then Break
            EndWhile
            sDataNew = StrReplace (sStrDataMask, @P1, udsStrEscape (StrSub (sData, 1, iPos)))
            FileWrite (hFW, sDataNew)
            sData = StrSub (sData, iPos + 1, -1)
         EndWhile
         FileWrite (hFW, StrReplace (StrReplace (sRegSetValueMask2, @P1, sRegHandle), @P3, sValue))
      Else
         sData = udsStrEscape (sData)
         FileWrite (hFW, StrReplace (StrReplace (StrReplace (sRegSetValueMask, @P1, sRegHandle), @P3, sValue), @P4, sData))
      EndIf
      Break
   EndSwitch
EndWhile
;..........................................................................................................................................
sMsgText = "Writing footer ..."
BoxText (sMsgText)
;..........................................................................................................................................
FileWrite (hFW, `BoxShut()`)
FileWrite (hFW, sRuler)
FileWrite (hFW, ``)
FileWrite (hFW, `sMsgText = StrCat(sFilename,@LF,"Completed.")`)
FileWrite (hFW, `Message(sMsgTitle,sMsgText)`)
FileWrite (hFW, ``)
FileWrite (hFW, `:CANCEL`)
FileWrite (hFW, `Exit`)
FileWrite (hFW, sRuler)
sYmdHmsStop = TimeYmdHms ()
FileWrite (hFW, `; Wbt created : ` : sYmdHmsStop)
FileWrite (hFW, sRuler)
;..........................................................................................................................................
FileClose (hFW)
;..........................................................................................................................................
BinaryFree (hBBHex)
BinaryFree (hBBSafe)
;..........................................................................................................................................
iTimeDiffSecs = TimeDiffSecs (sYmdHmsStop, sYmdHmsStart)
fLinesPerSec = 1. * iFileRegLines / iTimeDiffSecs
sMsgTextMask = "Reg file : {1}" : @LF : "Wbt file : {2}" : @LF : "Reg lines: {3}" : @LF : "Duration : {4} sec" : @LF : "Lines/sec: {5}" : @LF : "Conversion completed."
sMsgText = sMsgTextMask
sMsgText = StrReplace (sMsgText, @P1, sFileReg)
sMsgText = StrReplace (sMsgText, @P2, sFileWbt)
sMsgText = StrReplace (sMsgText, @P3, iFileRegLines)
sMsgText = StrReplace (sMsgText, @P4, iTimeDiffSecs)
sMsgText = StrReplace (sMsgText, @P5, fLinesPerSec)
WinPlace (100, 250, 900, 450, "")
BoxText (sMsgText)
;..........................................................................................................................................
MB_OK = 0
MB_ICONINFORMATION = 64
sMsgText = "Conversion Completed."
iResult = udfMsgBox (sMsgTitle, sMsgText, MB_OK | MB_ICONINFORMATION)
;..........................................................................................................................................
MB_YESNO = 4
MB_ICONQUESTION = 32
IDYES = 6
sMsgText = "Open target folder?"
iResult = udfMsgBox (sMsgTitle, sMsgText, MB_YESNO | MB_ICONQUESTION)
If (iResult == IDYES) Then Run ("explorer.exe", "/select, " : sFileWbt)
;..........................................................................................................................................
:CANCEL
BoxShut ()
Exit
;------------------------------------------------------------------------------------------------------------------------------------------


;------------------------------------------------------------------------------------------------------------------------------------------
; Information from the Platform SDK Release May 2002
;
;   Registry Element Size Limits
;   The following are the size limits for the various registry elements.
;
;   The maximum size of a key name is 255 characters.
;   The maximum size of a value name is as follows:
;   Windows XP, Windows .NET Server: 16383 characters
;   Windows 2000: 260 ANSI characters or 16383 Unicode characters.
;   Windows 95/98/Me: 255 characters
;   Long values (more than 2048 bytes) should be stored as files with the file names stored in the registry.
;   This helps the registry perform efficiently.
;   The maximum size of a value is as follows:
;   Windows NT/2000/XP: Available memory.
;   Windows 95/98/Me: 16,300 bytes. There is a 64K limit for the total size of all values of a key.
;
;   Windows 95/98/Me:
;   Every key has a default value that initially does not contain data.
;   On Windows 95, the default value type is always REG_SZ,
;   so the dwType parameter must specify REG_SZ for an unnamed value.
;   On Windows 98 and Windows Me, an unnamed value can be of any type.
;
;   Windows NT/2000/XP:
;   Registry keys do not have default values,
;   but they can have one unnamed value, which can be of any type.
;
;------------------------------------------------------------------------------------------------------------------------------------------



;------------------------------------------------------------------------------------------------------------------------------------------
; Example input Registry exportfile.
;------------------------------------------------------------------------------------------------------------------------------------------
;
;
;   REGEDIT4
;
;   [HKEY_USERS\testuser]
;
;   [HKEY_USERS\testuser\New Key #1]
;   "MenuItem1"="2,1,1,&Einfügen,Webview-Ordner&titel,<!--webbot bot=HTMLMarkup alt='&lt;B&gt;&lt;I&gt;Webview-Ordnertitel&lt;/I&gt;&lt;/B&gt;&nbsp;' startspan -->%THISDIRNAME%<!--webbot bot=HTMLMarkup endspan -->,&Bild...,2,Den Namen des aktuellen Ordners einfügen.,"
;   "MenuItem2"="2,1,1,&Einfügen,Webview-Ordnerin&halt,<!--webbot bot=HTMLMarkup u-src='file:///C:\\PROGRA~1\\MICROS~4\\Data\\FoldData.gif' startspan --><object width=100% height=85% classid=clsid:1820FED0-473E-11D0-A96C-00C04FD705A2></object><!--webbot bot=HTMLMarkup endspan -->,&Bild...,2,Den Inhalt des aktuellen Ordners (Programmsymbol) einfügen.,"
;   "MenuItem3"="2,1,1,&Einfügen,-,,&Bild...,,,"
;   "Microsoft.Vsa.Vb.CodeDOMProcessor,Version=\"7.0.3300.0\",PublicKeyToken=\"b03f5f7f11d50a3a\",Culture=\"neutral\""=hex(7):3f,\
;     52,25,5a,2d,3f,31,41,34,3d,6e,4d,27,33,6c,6b,72,3d,79,41,52,65,64,69,73,74,\
;     5f,50,61,63,6b,61,67,65,3e,71,5e,68,7a,68,47,3f,35,7d,3d,49,40,50,5a,5b,68,\
;     69,3d,4a,65,00,00
;   "^°!=\"§$%&/()=?{[]}\\´`@+*~#',;.:-_<>"="^°!=\"§$%&/()=?{[]}\\´`@+*~#',;.:-_<>"
;   "New Value #1"="dd"
;   "New Value #2"="aaa|bbb|ccc"
;   "New Value #3"=dword:00000221
;   "New Value #4"=hex:
;   "New Value #5"=hex:dd,dd
;   "New Value #6"=dword:000000dd
;   "New Value #7"=hex:10,20,30,00,10,20,30,40,00,10,20,30,40,50,00,00
;   "ExpSz"=hex(2):66,69,6c,65,3a,2f,2f,25,75,73,65,72,61,70,70,64,61,74,61,25,5c,\
;     4d,69,63,72,6f,73,6f,66,74,5c,49,6e,74,65,72,6e,65,74,20,45,78,70,6c,6f,72,\
;     65,72,5c,44,65,73,6b,74,6f,70,2e,68,74,74,00
;   "MulSz"=hex(7):6d,73,63,72,6c,72,65,76,2e,64,6c,6c,00,43,52,59,50,54,4e,45,54,\
;     2e,44,4c,4c,00,00
;   "Setup Components"=hex(7):42,41,53,45,49,45,34,30,5f,57,69,6e,00,49,45,45,58,\
;     00,4d,6f,62,69,6c,65,50,6b,00,42,52,41,4e,44,49,4e,47,2e,43,41,42,00,41,64,\
;     76,41,75,74,68,00,48,65,6c,70,43,6f,6e,74,00,49,43,57,00,46,6f,6e,74,63,6f,\
;     72,65,00,54,72,69,64,61,74,61,00,45,78,74,72,61,50,61,63,6b,00,41,64,64,72,\
;     65,73,73,42,6f,6f,6b,00,4d,61,69,6c,4e,65,77,73,00,6d,65,64,69,61,70,6c,61,\
;     79,65,72,00,77,6d,70,63,6f,64,65,63,00,4d,53,56,4d,4c,00,46,6c,61,73,68,00,\
;     4d,53,56,42,53,63,72,69,70,74,00,46,6f,6e,74,73,75,70,00,49,45,52,65,61,64,\
;     6d,65,00,00
;   "@@@"=""
;   @="testuser"
;
;
;------------------------------------------------------------------------------------------------------------------------------------------



;------------------------------------------------------------------------------------------------------------------------------------------
; Example output WinBatch scriptfile.
;------------------------------------------------------------------------------------------------------------------------------------------
;
;
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   ; This WinBatch script has been auto-generated by REG2WBT 1.03 (c)20030905 Detlev Dalitz
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   ; Reg origin  : W:\WINBATCH\PROD\REG2WBT\testuser.reg
;   ; Reg created : 2003:09:06:08:05:08
;   ; Reg lines   : 36
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   ; Wbt opened  : 2003:09:10:09:22:35
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;
;
;   sFilename = IntControl(1004,0,0,0,0)
;   sMsgTitle = "Import data into Windows Registry"
;   sMsgText = StrCat(sFilename,@LF,"Do you want to process this file",@LF,"and overwrite existing values in the Registry?")
;   Pause(sMsgTitle,sMsgText)
;
;
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   #DefineFunction udfGetDelimiter (sString)
;   ; Search #1.
;   If !StrIndex(sString,@TAB,1,@FWDSCAN) Then Return (@TAB)
;   ; Search #2.
;   If !StrIndex(sString,@LF,1,@FWDSCAN) Then Return (@LF)
;   ; Search #3.
;   If !StrIndex(sString,@CR,1,@FWDSCAN) Then Return (@CR)
;   ; Search #4.
;   sTable = "|#:;,./\!?=_-+*^~()[]{}<>&@$ "
;   sTable = StrClean(sTable,sString,"",@TRUE,1)
;   If (StrLen(sTable)>1) Then Return (StrSub(sTable,1,1))
;   ; Search #5.
;   For i=255 To 1 By -1
;      sTable = StrCat(sTable,Num2Char(i))
;   Next
;   sTable = StrClean(sTable,sString,"",@TRUE,1)
;   If (StrLen(sTable)>1) Then Return (StrSub(sTable,1,1))
;   ; No delimiters available.
;   Return ("")
;   #EndFunction
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;
;
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   #DefineFunction udfGetSzDelim (sSzData)
;   sSzData = StrReplace(StrReplace(sSzData,"00","")," ","")
;   If (sSzData>"")
;      hBB = BinaryAlloc(StrLen(sSzData)/2)
;      sSzDelim = udfGetDelimiter(BinaryPeekStr(hBB,0,BinaryPokeHex(hBB,0,sSzData)))
;      BinaryFree(hBB)
;   Else
;      sSzDelim = IntControl(29,"",0,0,0)
;   EndIf
;   Return (sSzDelim)
;   #EndFunction
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;
;
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   #DefineFunction udfConvertHexReg (sRegValue, sSzDelim)
;   If (sRegValue=="") Then Return ("")
;   If (sSzDelim>"") Then sSzDelim = StrSub(sSzDelim,1,1)
;      Else sSzDelim = IntControl(29,"",0,0,0)
;   hBB = BinaryAlloc(StrLen(sRegValue))
;   BinaryPokeStr(hBB,0,sSzDelim)
;   sSzDelimHex = BinaryPeekHex(hBB,0,1)
;   sRegValue = StrReplace(StrReplace(sRegValue,"00",sSzDelimHex)," ","")
;   iEod = BinaryPokeHex(hBB,0,sRegValue)-1
;   While (BinaryPeekStr(hBB,iEod,1)==sSzDelim)
;      iEod = iEod-1
;      If (iEod<0) Then Break
;   EndWhile
;   sSzValue = BinaryPeekStr(hBB,0,iEod+1)
;   BinaryFree(hBB)
;   Return (sSzValue)
;   #EndFunction
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;
;
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   ; Registration Database Operations
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   BoxOpen("Writing to Registry on Key ...","")
;   WinPlace(100,100,500,500,"")
;
;
;   sHKey = `HKEY_USERS`
;   sSubKey = ``
;   sSubKey = ItemInsert(`testuser`,-1,sSubKey,`\`)
;   BoxText(StrReplace(StrCat(sHKey,`\`,sSubKey),`\`,StrCat(`\`,@LF)))
;   If !RegExistKey(@REGUSERS,sSubKey)
;      RegCreateKey(@REGUSERS,sSubKey)
;   EndIf
;
;   sHKey = `HKEY_USERS`
;   sSubKey = ``
;   sSubKey = ItemInsert(`testuser`,-1,sSubKey,`\`)
;   sSubKey = ItemInsert(`New Key #1`,-1,sSubKey,`\`)
;   BoxText(StrReplace(StrCat(sHKey,`\`,sSubKey),`\`,StrCat(`\`,@LF)))
;   If !RegExistKey(@REGUSERS,sSubKey)
;      RegCreateKey(@REGUSERS,sSubKey)
;   EndIf
;   sStrData = ``
;   sStrData = StrCat(sStrData,`2,1,1,&Einfügen,Webview-Ordner&titel,<!--webbot bot=HTMLMarkup alt='&lt;B&g`)
;   sStrData = StrCat(sStrData,`t;&lt;I&gt;Webview-Ordnertitel&lt;/I&gt;&lt;/B&gt;&nbsp;' startspan -->%%THI`)
;   sStrData = StrCat(sStrData,`SDIRNAME%%<!--webbot bot=HTMLMarkup endspan -->,&Bild...,2,Den Namen des akt`)
;   sStrData = StrCat(sStrData,`uellen Ordners einfügen.,`)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[MenuItem1]`),sStrData)
;   sStrData = ``
;   sStrData = StrCat(sStrData,`2,1,1,&Einfügen,Webview-Ordnerin&halt,<!--webbot bot=HTMLMarkup u-src='file`)
;   sStrData = StrCat(sStrData,`:///C:\PROGRA~1\MICROS~4\Data\FoldData.gif' startspan --><object width=`)
;   sStrData = StrCat(sStrData,`100%% height=85%% classid=clsid:1820FED0-473E-11D0-A96C-00C04FD705A2></object`)
;   sStrData = StrCat(sStrData,`><!--webbot bot=HTMLMarkup endspan -->,&Bild...,2,Den Inhalt des aktuellen `)
;   sStrData = StrCat(sStrData,`Ordners (Programmsymbol) einfügen.,`)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[MenuItem2]`),sStrData)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[MenuItem3]`),`2,1,1,&Einfügen,-,,&Bild...,,,`)
;   sMulSzData = ``
;   sMulSzData = StrCat(sMulSzData,`3f `)                                                                         ; [?]
;   sMulSzData = StrCat(sMulSzData,`52 25 5a 2d 3f 31 41 34 3d 6e 4d 27 33 6c 6b 72 3d 79 41 52 65 64 69 73 74 `) ; [R.Z-?1A4=nM'3lkr=yARedist]
;   sMulSzData = StrCat(sMulSzData,`5f 50 61 63 6b 61 67 65 3e 71 5e 68 7a 68 47 3f 35 7d 3d 49 40 50 5a 5b 68 `) ; [_Package>q^hzhG?5}=I@PZ[h]
;   sMulSzData = StrCat(sMulSzData,`69 3d 4a 65 00 00`)                                                           ; [i=Je..]
;   sSzDelim = udfGetSzDelim(sMulSzData)
;   sMulSzData = udfConvertHexReg(sMulSzData,sSzDelim)
;   RegSetMulSz(@REGUSERS,StrCat(sSubKey,`[Microsoft.Vsa.Vb.CodeDOMProcessor,Version="7.0.3300.0",PublicKeyToken="b03f5f7f11d50a3a",Culture="neutral"]`),sMulSzData,sSzDelim)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[^°!="§$%%&/()=?{[]}\´``@+*~#',;.:-_<>]`),`^°!="§$%%&/()=?{[]}\´``@+*~#',;.:-_<>`)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[New Value #1]`),`dd`)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[New Value #2]`),`aaa|bbb|ccc`)
;   RegSetDword(@REGUSERS,StrCat(sSubKey,`[New Value #3]`),545)
;   sBinData = ``
;   RegSetBin(@REGUSERS,StrCat(sSubKey,`[New Value #4]`),sBinData)
;   sBinData = ``
;   sBinData = StrCat(sBinData,`dd dd`)                                                                           ; [..]
;   RegSetBin(@REGUSERS,StrCat(sSubKey,`[New Value #5]`),sBinData)
;   RegSetDword(@REGUSERS,StrCat(sSubKey,`[New Value #6]`),221)
;   sBinData = ``
;   sBinData = StrCat(sBinData,`10 20 30 00 10 20 30 40 00 10 20 30 40 50 00 00`)                                 ; [. 0.. 0@.. 0@P..]
;   RegSetBin(@REGUSERS,StrCat(sSubKey,`[New Value #7]`),sBinData)
;   sExpSzData = ``
;   sExpSzData = StrCat(sExpSzData,`66 69 6c 65 3a 2f 2f 25 75 73 65 72 61 70 70 64 61 74 61 25 5c `)             ; [file://.userappdata.\]
;   sExpSzData = StrCat(sExpSzData,`4d 69 63 72 6f 73 6f 66 74 5c 49 6e 74 65 72 6e 65 74 20 45 78 70 6c 6f 72 `) ; [Microsoft\Internet Explor]
;   sExpSzData = StrCat(sExpSzData,`65 72 5c 44 65 73 6b 74 6f 70 2e 68 74 74 00`)                                ; [er\Desktop.htt.]
;   sExpSzData = udfConvertHexReg(sExpSzData,``)
;   RegSetExpSz(@REGUSERS,StrCat(sSubKey,`[ExpSz]`),sExpSzData)
;   sMulSzData = ``
;   sMulSzData = StrCat(sMulSzData,`6d 73 63 72 6c 72 65 76 2e 64 6c 6c 00 43 52 59 50 54 4e 45 54 `)             ; [mscrlrev.dll.CRYPTNET]
;   sMulSzData = StrCat(sMulSzData,`2e 44 4c 4c 00 00`)                                                           ; [.DLL..]
;   sSzDelim = udfGetSzDelim(sMulSzData)
;   sMulSzData = udfConvertHexReg(sMulSzData,sSzDelim)
;   RegSetMulSz(@REGUSERS,StrCat(sSubKey,`[MulSz]`),sMulSzData,sSzDelim)
;   sMulSzData = ``
;   sMulSzData = StrCat(sMulSzData,`42 41 53 45 49 45 34 30 5f 57 69 6e 00 49 45 45 58 `)                         ; [BASEIE40_Win.IEEX]
;   sMulSzData = StrCat(sMulSzData,`00 4d 6f 62 69 6c 65 50 6b 00 42 52 41 4e 44 49 4e 47 2e 43 41 42 00 41 64 `) ; [.MobilePk.BRANDING.CAB.Ad]
;   sMulSzData = StrCat(sMulSzData,`76 41 75 74 68 00 48 65 6c 70 43 6f 6e 74 00 49 43 57 00 46 6f 6e 74 63 6f `) ; [vAuth.HelpCont.ICW.Fontco]
;   sMulSzData = StrCat(sMulSzData,`72 65 00 54 72 69 64 61 74 61 00 45 78 74 72 61 50 61 63 6b 00 41 64 64 72 `) ; [re.Tridata.ExtraPack.Addr]
;   sMulSzData = StrCat(sMulSzData,`65 73 73 42 6f 6f 6b 00 4d 61 69 6c 4e 65 77 73 00 6d 65 64 69 61 70 6c 61 `) ; [essBook.MailNews.mediapla]
;   sMulSzData = StrCat(sMulSzData,`79 65 72 00 77 6d 70 63 6f 64 65 63 00 4d 53 56 4d 4c 00 46 6c 61 73 68 00 `) ; [yer.wmpcodec.MSVML.Flash.]
;   sMulSzData = StrCat(sMulSzData,`4d 53 56 42 53 63 72 69 70 74 00 46 6f 6e 74 73 75 70 00 49 45 52 65 61 64 `) ; [MSVBScript.Fontsup.IERead]
;   sMulSzData = StrCat(sMulSzData,`6d 65 00 00`)                                                                 ; [me..]
;   sSzDelim = udfGetSzDelim(sMulSzData)
;   sMulSzData = udfConvertHexReg(sMulSzData,sSzDelim)
;   RegSetMulSz(@REGUSERS,StrCat(sSubKey,`[Setup Components]`),sMulSzData,sSzDelim)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[@@@]`),``)
;   RegSetValue(@REGUSERS,StrCat(sSubKey,`[]`),`testuser`)
;
;   BoxShut()
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;
;   sMsgText = StrCat(sFilename,@LF,"Completed.")
;   Message(sMsgTitle,sMsgText)
;
;   :CANCEL
;   Exit
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;   ; Wbt created : 2003:09:10:09:22:39
;   ;--------------------------------------------------------------------------------------------------------------------------------------------
;
;
;--------------------------------------------------------------------------------------------------------------------------------------------
;;;

Article ID:   W18233
Filename:   Registry Script Generator.txt
File Created: 2009:07:22:14:28:56
Last Updated: 2009:07:22:14:28:56