Python Forum
deleting files in program files directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
deleting files in program files directory
#3
Thanks, I did a pip install of pyuac, however I get an error

D:\python>py FFdelete.py
File "D:\python\FFdelete.py", line 12
file_path = r'C:\Program Files (x86)\Microsoft\'
^
SyntaxError: unterminated string literal (detected at line 12)

and line 12 = file_path = r'C:\Program Files (x86)\Microsoft\'

I tried the above and using double quotes with the r inside the quotes as well.

I found I had to use \ so the path is
file_path = "C:\\Program Files (x86)\\Microsoft\\"

But then I get this error
PermissionError: [WinError 5] Access is denied: 'C:\\Program Files (x86)\\Microsoft\\'
Reply


Messages In This Thread
RE: deleting files in program files directory - by RRADC - Aug-19-2024, 05:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Correct/proper way to create save files snakes 0 438 Mar-11-2025, 06:58 PM
Last Post: snakes
  Merge htm files with shutil library (TypeError: 'module' object is not callable) Melcu54 7 3,299 Mar-09-2025, 04:25 PM
Last Post: Pedroski55
  how to download large files faster? kucingkembar 3 776 Feb-20-2025, 06:57 PM
Last Post: snippsat
  Inserting Python Buttons into KV Files edand19941 3 474 Feb-19-2025, 07:44 PM
Last Post: buran
Question [SOLVED] Right way to open files with different encodings? Winfried 3 3,965 Jan-18-2025, 02:19 PM
Last Post: Winfried
  Applications config files / Best practices aecordoba 2 1,854 Oct-23-2024, 12:56 PM
Last Post: aecordoba
  Compare 2 files for duplicates and save the differences cubangt 2 926 Sep-12-2024, 03:55 PM
Last Post: cubangt
  Convert Xls files into Csv in on premises sharpoint Andrew_andy9642 3 984 Aug-30-2024, 06:41 PM
Last Post: deanhystad
  I'm trying to merge 2 .csv files with no joy! Sick_Stigma 3 914 Aug-03-2024, 03:20 PM
Last Post: mariadsouza362
  Class test : good way to split methods into several files paul18fr 5 3,534 Jul-17-2024, 11:12 AM
Last Post: felixandrea

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020