Trying to modify the 3rd line in a text file (which is exported registry key data).
In the text file itself, the first line is the standard "Windows Registry Editor Version 5.00" line that one gets when exporting registry. The second line is blank, the third line contains the string that I need to change. The lines following that are the (hex) data.
For some reason, the first ReadLine returns 3 characters of junk data then the following readlines return empty. I have reviwed this code many times and also compared it against other (successful) examples of similar code I have written in the past. I cannot discover what I (or QARun) is doing wrong. Here is the code.
If FileExists(strRegistryFilesPath + "\32BitRIP_SL71_DefaultLndscpe.reg")
strRegFilePathAndName = strRegistryFilesPath + "\32BitRIP_SL71_DefaultLndscpe.reg"
iResult = Open(strRegFilePathAndName, "readwrite")
sav = FilePos( strRegFilePathAndName)
ret = ReadLine( strRegFilePathAndName, strFindRegPath)
If FindStr( strFindRegPath, "[HKEY_CURRENT_USER\Software\Cadlink\" ) != 0
FilePos( strRegistryFilesPath + "\32BitRIP_SL71_DefaultLndscpe.reg", sav )
strNewRegPath = ReplaceStr(strFindRegPath, "[" + strSLHKCURegKey + "Streams]", 1)
WriteLine( strRegFilePathAndName, strNewRegPath)
Loop While ret <> 0
exec ("regedit.exe /s " + strRegistryFilesPath + "\32BitRIP_SL71_DefaultLndscpe.reg")
msgbox("Registry File Not Available", "There was no Reg file 32BitRIP_SL71_DefaultLndscpe.reg")