The point is that you need to ask to windows for the ProgramData folder path because it can change on different windows versions, especially if you want to give support for XP and Vista. It also happens that a user can install windows on any drive on his system, so it can easily not be C:. Hardcode a path out of your game installation folder is not a good practice and, as you experienced, ProgramFiles folder is locked for writting on newest systems.