Being the owner does not automatically grant you the right to modify a file or directory. There's an ACL (access control list) that's preventing you from doing what you want. You can display or edit the ACL using the cacls
command. For example, here's the ACL on my own Program Files
directory:
12 C% cacls '\Program Files'
C:\Program Files NT SERVICE\TrustedInstaller:F
NT SERVICE\TrustedInstaller:(CI)(IO)F
NT AUTHORITY\SYSTEM:C
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
BUILTIN\Administrators:C
BUILTIN\Administrators:(OI)(CI)(IO)F
BUILTIN\Users:R
BUILTIN\Users:(OI)(CI)(IO)(special access:)
GENERIC_READ
GENERIC_EXECUTE
CREATOR OWNER:(OI)(CI)(IO)F
Unless you have a really good reason you haven't mentioned, you probably don't want to change the ACL on this directory. But if you really, really do, here's how you'd give yourself full control:
cacls '\Program Files' /E /G userid:F
Added:
That cacls
command modifies the ACL on just that directory, not the contents. If you'd like to edit a config file somewhere in your Program Files
directory tree, you'll need to use the cacls
command on that file itself. For example:
cacls '\Program Files\FooBarGame\ConfigDirectory\ConfigFile' /E /G userid:F
Program Files
folder] Oh boy...