Open file with associated application

Just write System.Diagnostics.Process.Start(@”file path”); example System.Diagnostics.Process.Start(@”C:\foo.jpg”); System.Diagnostics.Process.Start(@”C:\foo.doc”); System.Diagnostics.Process.Start(@”C:\foo.dxf”); … And shell will run associated program reading it from the registry, like usual double click does.

Windows is not passing command line arguments to Python programs executed from the shell

I think I solved this. For some reason there is a SECOND place in the registry (besides that shown by the file associations stored in HKEY_CLASSES_ROOT\Python.File\shell\open\command): [HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command] @=”\”C:\\Python25\\python.exe\” \”%1\” %*” This seems to be the controlling setting on my system. The registry setting above adds the “%*” to pass all arguments to python.exe (it was … Read more

How to execute Python scripts in Windows?

When you execute a script without typing “python” in front, you need to know two things about how Windows invokes the program. First is to find out what kind of file Windows thinks it is: C:\>assoc .py .py=Python.File Next, you need to know how Windows is executing things with that extension. It’s associated with the … Read more

tech