TFra6
TFra6

Reputation: 1

Windows "Open with" a file with self-extracting CAB Win32

Using the IExpress utility present on Windows, I created a self-extracting EXE (self-extracting Win32 CAB), which will be used to open Python files. During building, I checked the "extract files and run an installation command" option and typed "cmd /c myfile.bat" to install the program. Concerning the source BAT file, instead, it contains only one line (START "" "C:\Program Files\Spyder\Python\pythonw.exe" "C:\Program Files\Spyder\Spyder.launch.pyw" %1, to be specific), which is used to open Python scripts (.py) via the Spyder IDE.

Now, if I double-click on the new resulting EXE, it extracts and launches the correct application, as expected. However, if I right-click on a generic PY file, select "Open with", and choose the EXE as a program to open the file, everything stops and I get a "Command line option syntax error. Type command /? for help" message.

It occurs to me that a possible solution is to modify the installation command on IExpress (cmd /c myfile.bat), or to appropriately modify the batch file. However, given my very little knowledge on the subject, I don't know how to do it.

How can I solve this problem without having to use external programs, going directly through the EXE?

Upvotes: 0

Views: 59

Answers (0)

Related Questions