0

I'm trying to launch python file (here pdfid.py) from my cmd like that : pdfid.py mypdf.pdf

But the .py file don't work

But it worked when I use the cmd :

python <PATH>\pdfid.py mypdf.pdf

I already added the pdfid on my windows PATH and python (python version 3)

I tried to change the executable python who launched the pdfid.py but it didn't worked I tried to create a shortcut pdfid.py who launched the cmd : cmd /k <PATH>/pdfid.py but it don't work either

Rayteur
  • 1
  • 2
  • [Setting "open with"](https://stackoverflow.com/a/1934695/10513287) might be enough, but the other answer has a detailed manual explanation. – ivvija Apr 17 '23 at 11:36

1 Answers1

0

Thanks to @ivvija Setting "open with" did help me

When I ftype my Python.File, it was linked to C:\Python27\python.exe and not to C:\Windows\py.exe

I changed it with the command line :

ftype Python.File="C:\Windows\py.exe" "%1" %*

%1 to pass script name and all command-line parameters %* to py executable

But it was not enough, I had also to change the properties of the file .py to open it with py.exe

Rayteur
  • 1
  • 2