If you prefer not to screw around with the registry, newer versions of Windows have an alternate:
Control Panel: Control Panel\Programs\Default Programs\Set Associations
- Programs
- Default Programs
- Set Associations
Settings: Windows 10
- System
- Default Apps
- Choose default apps by file type
In both cases, locate .PY and .PYW, and change their program to python.exe or pythonw.exe respectively (py.exe and pyw.exe).
This will automatically set the path to the executable followed by the missing in your case part: %1
. This variable is replaced by the name of your py(w)
file.