Jump to content

Python 3 Windows 7, Creating a script which attempts to open files on my C drive and search for a...


G+_Rud Dog
 Share

Recommended Posts

Python 3 Windows 7, Creating a script which attempts to open files on my C drive and search for a keyword. Unfortunately when I come to this hwcompat.txt file it OSError: [Error22] since could not find any help from google decided to try it on my own but this is as far as I got.

First thing was to try and open the file myself manually not using my script and I do get this:

Reviewing the permissions I see these selections anyone know which one is causing the denied access. Also how does the edit button get that shield attached to it? BTW I duplicated the "SYSTEM" permission on another file but my script reported it existed and accessible.????

hwcompat_txt.pngtrusted_user.png
Link to comment
Share on other sites

Thank you Akira Yamanita since that was one of two files causing the problem on my entire machine decided to bypass them and just not the name and path to each file. The part that confuses me is why would a text file be protected against access by the owner of the  machine who btw is also the admin?

Link to comment
Share on other sites

UAC protects certain files and directories. Try running from command line as administrator? I believe there's a separation between an administrator who can elevate his permission and running with administrator permission continuously.

 

The hosts file is a text file and definitely deserves protection.

Link to comment
Share on other sites

Thank you Jeff Brand now I can google that one and figure out how and if I can use this algorithm. This is my return to programming after about 10 years of doing other things. Forget how much it was enjoyed. But now with the help of communities the steering for my ideas are keep on the right course. Again Thank  you. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...