0

I am trying to augment C:\program files\%X%\%text_file%.txt .

I am admin on my PC and granted full access to all users on this text file (overkill, but its a local PC).

I am trying to use the solution documented here, yet I am still getting WindowsError: [Error 5] Access is denied.

My goal would be to have a script that systematically can go in and modify the text file. My current python code matches that in the link above directly.

Thank you for any guidance!!

Community
  • 1
  • 1
jason m
  • 6,519
  • 20
  • 69
  • 122

1 Answers1

0

Without sample code to demonstrate the usage, I can only presume that you are using "C:\program files\%X%\%text_file%.txt" directly and there are no valid environment variables for "X" and "text_file" for it to replace with.

On Windows, a value wrapped in % is expanded and replaced with an environment variable. For example echo %TEMP% at the Command Prompt (CMD.EXE) will expand out the TEMP environment variable and print out something like C:\Program Files\Temp

I hope this helps

Jason De Arte
  • 467
  • 1
  • 3
  • 14