Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Stupid python error for simple program (permission) HELP

Im having this problem with python , where it gives me the error:

PermissionError: [WinError 5] Access is denied: 'C:\\Users\\Daniel\\Desktop\\Patch-Keygen'

for a code as simple as :
import sys
import random
import os
import string
import time

os.remove('C:\\Users\\Daniel\\Desktop\\Patch-Keygen')


Ive also tried running it as administrator (both PyCharm and python.exe) and nothing seems to work?

Any ideas on what i should do/am doing wrong? Thanks in advance
I asume it is a folder with content you are trying to remove.

You can fix it with.

Code
import shutil

shutil.rmtree('/folder_name')

https://stackoverflow.com/questions/3032...ith-python
Thank you so much this helped a bunch! i already love these forums :D

(now i can make my malicious programs B| )


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 630 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[Python] by SailorDec 14, 2021 11:55 AM 1 106 Dec 14, 2021 11:55 AM
Last Post: Edge
[C#] by gigajewJun 20, 2018 07:26 AM 2 289 Jun 20, 2018 07:26 AM
Last Post: JustNothing