Read ini file in System32 problem Win7 x64

Read ini file in System32 problem Win7 x64

1
NewbieNewbie
1

    Apr 24, 2010#1

    I have new laptop with Win7 x64. UE v15.10.0.1031 installed
    Strange problem reading text file (.ini) in \Windows\System32 folder.
    Ini file is created by a service application I wrote. Creates one section with one property=value. total of 2 lines.
    File size 22 bytes, file attributes 'A'
    If I open file with UE, see nothing.
    If I open file with notepad, see:
    [SOCKET]
    port=xxxxx
    Run this same code on XP, do not have a problem viewing file contents with UE.
    same result trying to read \windows\system32\tcpmon.ini- reads OK with notepad, nothing with UE (file attribute 'A')
    also tried a text file- opened \windows\system32\catroot2\dberr.txt- can view full contents with UE
    File attributes for this file are 'AI' - I have no clue what the 'I' attribute is. Anyone?
    Is the attribute the issue, or the file extension?
    Or is this a role/rights issue?
    This problem is not limited to UE. Another application in my suite is unable to read from the file also.
    Just wondering if anyone has come across this problem.

    901
    MasterMaster
    901

      Apr 24, 2010#2

      Yes, I have the same problem with some files, including c:\windows\system32\tcpmon.ini
      On my Windows 7 64-bit system, some applications can read the file (notepad and BeyondCompare, for example)
      Some cannot (UltraEdit and UltraCompare, for example)

      I reported this issue via email to the IDM support team.

      6,603548
      Grand MasterGrand Master
      6,603548

        Apr 25, 2010#3

        Attribute I marks the file for not being indexed by the operating system's content indexing service, see FileAttributes Enumeration.

        I don't have Windows Vista or Windows 7. However, I suggest to start UltraEdit by right-clicking on its shortcut in the start menu or desktop and click on Run as administrator. Then open the file in the system32 directory. This hint is taken from Microsoft support article You cannot modify the Hosts file or the Lmhosts file in Windows Vista and Windows 7.
        Best regards from an UC/UE/UES for Windows user from Austria

        901
        MasterMaster
        901

          Apr 25, 2010#4

          Even the local administrator does not have more than read or execute access on the tcpmon.ini file in Windows 7. The file is owned by an identity called TrustedInstaller. Perhaps taking ownership of the file would make a difference... however I prefer not to mess with the security settings in Windows when it is obvious that the inability to open the file is application-specific.

          6,603548
          Grand MasterGrand Master
          6,603548

            Apr 26, 2010#5

            Thanks bulgrien. Now it is clear why those files could not be opened with UltraEdit.

            Some INI files in system32 directory or a subdirectory of it are critical system configuration files which can be modified only by the system and/or network service accounts and are created by the special installer account (TrustedInstaller). Only applications opening by default files with only read access can open those files for viewing.

            But UltraEdit as a text editor and not a text viewer wants to open by default all files with full read/write access which is denied by the security settings. A workaround would be probably to copy those files to a different directory without copying the special permissions for viewing them with UltraEdit. Of course you could also modify that copy, but the modified file could not be copied back to original location without changing the security settings at least temporarily.

            IDM could make an improvement on their file open strategy. If opening an existing file fails with full read/write access, their products could try to open the file in read-only open mode and of course indicate the user that this file can't be edited like a file which has read-only attribute set.
            Best regards from an UC/UE/UES for Windows user from Austria

            79
            Advanced UserAdvanced User
            79

              Apr 26, 2010#6

              Another possibility (or at least factor) is that WOW64 might be redirecting the file access from \windows\system32 to \windows\syswow64.

              Try opening the file using the "\windows\sysnative" alias which redirects back to the true \windows\system32 directory.

              http://msdn.microsoft.com/en-us/library/aa384187.aspx

              901
              MasterMaster
              901

                Apr 26, 2010#7

                Thank you mwb...

                The path "C:\Windows\sysnative\tcpmon.ini" certainly does open in UE. IDM is aware of this redirection issue under Windows Vista and Windows 7 and will look into it for a future release of their products. Although providing an alternate path is an inconvenience, perhaps it is also a viable work-around for the original poster.