Akton Posted November 11, 2009 Share Posted November 11, 2009 I was testing IniReadSectionNames and started by using the example from the manual $var = IniReadSectionNames(@WindowsDir & "\win.ini") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $var[0] MsgBox(4096, "", $var[$i]) Next EndIf But it returns sections which are NOT in the win.ini files? (Things like "Aedebug" or "Colors") I checked the path, which was C:\windows\win.ini opened it in an editor and the headers i checked weren't in the file. Then i tried copying the win.ini file from windows to c:\ and changed the test to read it from there - and THEN it showed the section names in the win.ini file?? Why is that? Is that a bug or something I don't know about? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted November 11, 2009 Share Posted November 11, 2009 Maybe it's Windows way of saying, dont screw around with win.ini? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
ResNullius Posted November 11, 2009 Share Posted November 11, 2009 I was testing IniReadSectionNames and started by using the example from the manual $var = IniReadSectionNames(@WindowsDir & "\win.ini") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else For $i = 1 To $var[0] MsgBox(4096, "", $var[$i]) Next EndIf But it returns sections which are NOT in the win.ini files? (Things like "Aedebug" or "Colors") I checked the path, which was C:\windows\win.ini opened it in an editor and the headers i checked weren't in the file. Then i tried copying the win.ini file from windows to c:\ and changed the test to read it from there - and THEN it showed the section names in the win.ini file?? Why is that? Is that a bug or something I don't know about? " Starting with NT based versions of Windows, OS ini files were remapped to the registry, which is also where the "Aedebug" and other values that aren't in the actual ini file are coming from. You can find the remappings in the registry at "HKEY_LOCAL_MACHINE \Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping" API calls (including those used by AutoIt's Ini functions) to read and write OS ini files are redirected to the registry. Moving or changing the name of the OS ini files causes them to be seen as regular ini files so no registry redirect occurs when reading/writing them. More info here: http://technet.microsoft.com/en-us/library/cc722567.aspx and here: http://support.microsoft.com/kb/102889 Link to comment Share on other sites More sharing options...
Akton Posted November 12, 2009 Author Share Posted November 12, 2009 "Starting with NT based versions of Windows, OS ini files were remapped to the registry, which is also where the "Aedebug" and other values that aren't in the actual ini file are coming from. You can find the remappings in the registry at "HKEY_LOCAL_MACHINE \Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping" Ahh. Good explanation ResNullius - perhaps that should be included in the help file so as not to confuse others Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now