1

I am trying to use a pip feature in python called pyperclip, I am working through automate the boring stuff by Al Siegwart.

I am supposed to open a file editor and save the file as mclip.bat in the C:\Windows folder:

First it has you build it in MU and save as mclip.py then it has you create a batch file to run the program with the win-R run window

That file looks like this:

@py.exe C:\path_to_file\mclip.py %*

@pause

When I try to save this file to the C:\Windows folder I get the error you dont have permission to save in this location. Contact the administrator to obtain permission I am the sole user of the computer and the admin.

It also says, would you like to save this in Alex instead? and when I say no it doesn't save

After this when I try to run the program on Win-r by typing mclip the following message appears:

C:\Users\Alex\AppData\Local\Programs\Python\Python37\python.exe: can't open file 
C:\path_to_file\mclip.py': [Errno 2] No such file or directory
Press any key to continue . . .
Kim Tang
  • 2,330
  • 2
  • 9
  • 34
Alex
  • 11
  • 4
  • 1
    You likely need to run the batch file as an administrator, as this would be UAC stepping in to try prevent anything occurring without permission. There is an answer on `SuperUser` for having a batch automatically run as Admin [link](https://superuser.com/questions/788924/is-it-possible-to-automatically-run-a-batch-file-as-administrator) – PacketLoss Sep 03 '20 at 05:18
  • @PacketLoss Thanks so much for your response, so I followed the info in the link but when I go to the advanced setting the box to check for run as admin is greyed out and unclickable, I tried some of the other methods mentioned but I'm not sure, there may be an underlying issue, I was having a hard time getting pip installed too so there may be some type of PATH issue as well but again im such a noob im not sure – Alex Sep 03 '20 at 05:48
  • Are you trying to make this change on a shortcut, or the file itself? – PacketLoss Sep 03 '20 at 05:50
  • @PacketLoss I am trying to make the change to the shortcut, as specified in the Link above – Alex Sep 03 '20 at 07:33

0 Answers0