Aug-20-2024, 01:31 PM
Oh, lookie there, I learned a new thing each today with python! Thanks
However, I did run this as is and while it did eliminate the errors but no directories or files where deleted. I ran this version multiple times. I went to the directory C:\Program Files (x86)\Microsoft and changed the permissions to the Microsoft directory. Then it started throwing the permission error again.
For some reason, that directory keeps defaulting to read only, but I can delete the files manually. Something
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
C:\Program Files (x86)\Microsoft\New folder\QUO-186042-0 AMPL-125S1G6 for Abbott Diabetes Care.pdf
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
C:\Program Files (x86)\Microsoft\New folder\QUO-186042-0 AMPL-125S1G6 for Abbott Diabetes Care.pdf
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
C:\Program Files (x86)\Microsoft\New folder\QUO-186042-0 AMPL-125S1G6 for ADC.pdf
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
Traceback (most recent call last):
File "D:\python\FFdelete.py", line 24, in <module>
os.remove(file_path)
PermissionError: [WinError 5] Access is denied: 'C:\\Program Files (x86)\\Microsoft\\usb1.spec'
These files I put there to test with.
Probably another dumb question but what does this "if 'url_sample.csv'" do for this script?
However, I did run this as is and while it did eliminate the errors but no directories or files where deleted. I ran this version multiple times. I went to the directory C:\Program Files (x86)\Microsoft and changed the permissions to the Microsoft directory. Then it started throwing the permission error again.
For some reason, that directory keeps defaulting to read only, but I can delete the files manually. Something
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
C:\Program Files (x86)\Microsoft\New folder\QUO-186042-0 AMPL-125S1G6 for Abbott Diabetes Care.pdf
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
C:\Program Files (x86)\Microsoft\New folder\QUO-186042-0 AMPL-125S1G6 for Abbott Diabetes Care.pdf
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
C:\Program Files (x86)\Microsoft\New folder\QUO-186042-0 AMPL-125S1G6 for ADC.pdf
D:\python>py FFdelete.py
C:\Program Files (x86)\Microsoft\usb1.spec
Traceback (most recent call last):
File "D:\python\FFdelete.py", line 24, in <module>
os.remove(file_path)
PermissionError: [WinError 5] Access is denied: 'C:\\Program Files (x86)\\Microsoft\\usb1.spec'
These files I put there to test with.
Probably another dumb question but what does this "if 'url_sample.csv'" do for this script?