Why am i getting WindowsError: [Error 5] Access is denied?

前端 未结 2 951
情书的邮戳
情书的邮戳 2020-12-07 01:06

Trying to create program that adds folders into program files-recieving this error:

WindowsError: [Error 5] Access is denied \'C:\\\\Program Files\\\\IMP\'
         


        
相关标签:
2条回答
  • 2020-12-07 01:19

    Because you have to have the "system administrator privileges" to create dirs under C:\Program Files.

    So try run the script with system administrators privilege.


    To start a command prompt as an administrator

    1. Click Start.
    2. In the Start Search box, type cmd, and then press CTRL+SHIFT+ENTER.
    3. Run the python script.
    0 讨论(0)
  • 2020-12-07 01:22

    Right click on file (which file/folder's permissions needed to execute the script) go properties, security and enable all permissions, little checkboxes -> ALLOW: "every application package & limited application package & trusted installer"

    this is it :)

    0 讨论(0)
提交回复
热议问题