Python script embedded in windows registry

We all know windows have a function that you can right-click on a file, and numerous options are shown. Well, you can add value to this menu. I followed this tutorial: jfitz.com/tips/rclick_custom.html

Basically I have a script that runs when I right click on a certain type of file. Ok, so everything is going flawlessly, however, when I finish and try to test this, Windows tells me that it only accepts .exe files.

Is this their way of getting around this without using py2exe or something?

** EDIT So, if my script takes the first argument as a parameter, how would I put it in the registry?

"C: \ Python26 \ pythonw.exe C: \ Users \ daved \ Documents \ Python \ backup.py"% 1 ""

0


a source to share


1 answer


yes, call pythonw.exe and pass the script path as a parameter

"C:\Python26\pythonw.exe" "C:\Users\daved\Documents\Python\backup.py" "%1"

      



It is also recommended (but not required) to use the .pyw extension when your script is not running in the console.

+2


a source







All Articles