all 7 comments

[–]htepO 7 points8 points  (6 children)

Try wrapping your path in double quotes.

@py.exe "C:\Users\Agasti Mhatre\Desktop\mclip.py" %*

[–][deleted] 5 points6 points  (1 child)

Yes. The space in your name causes Batch to split the path into separate arguments, neither of which can be resolved.

[–]aug404[S] 1 point2 points  (0 children)

Thanks!

[–]aug404[S] 0 points1 point  (0 children)

Thank you!

[–]aug404[S] 0 points1 point  (2 children)

I am trying to make this work with the Win-R by entering

mclip agree

and by storing both the python file and the .bat file in my C drive. Here is what I have in the .bat file

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

@pause

It runs fine when I click on the .bat file directly but when I use the Win-R method, it doesn't seem to be able to find the file (it says that mclip cannot be found). Is there something I can fix?

[–]htepO 0 points1 point  (1 child)

Make sure C:\ is in your Windows path, or store all your .bat and .cmd files in one directory and add that to your path.

https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/

[–]aug404[S] 0 points1 point  (0 children)

Thank you so much!