Read ini file in System32 problem Win7 x64

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Read ini file in System32 problem Win7 x64

Postby cmimpb » Sat Apr 24, 2010 8:44 am

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.
cmimpb
Newbie
 
Posts: 1
Joined: Sat Apr 24, 2010 8:23 am

Re: Read ini file in System32 problem Win7 x64

Postby bulgrien » Sat Apr 24, 2010 5:35 pm

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.
User avatar
bulgrien
Master
Master
 
Posts: 92
Joined: Fri Dec 11, 2009 1:02 am
Location: Pennsylvania, USA

Re: Read ini file in System32 problem Win7 x64

Postby Mofi » Sun Apr 25, 2010 4:27 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Read ini file in System32 problem Win7 x64

Postby bulgrien » Sun Apr 25, 2010 1:13 pm

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.
User avatar
bulgrien
Master
Master
 
Posts: 92
Joined: Fri Dec 11, 2009 1:02 am
Location: Pennsylvania, USA

Re: Read ini file in System32 problem Win7 x64

Postby Mofi » Mon Apr 26, 2010 12:52 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Read ini file in System32 problem Win7 x64

Postby mwb1100 » Mon Apr 26, 2010 11:39 am

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
User avatar
mwb1100
Basic User
Basic User
 
Posts: 46
Joined: Tue Nov 21, 2006 12:00 am

Re: Read ini file in System32 problem Win7 x64

Postby bulgrien » Mon Apr 26, 2010 3:31 pm

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.
User avatar
bulgrien
Master
Master
 
Posts: 92
Joined: Fri Dec 11, 2009 1:02 am
Location: Pennsylvania, USA


Return to UltraEdit General Discussion