Execute external file/program
I am looking for a code snippet which executes a file at any given location.
If it was given the location, "E:\Manuals\readme.txt".
It would open up the specified text document using the default program.
Or if it was given the location, "E:\games\game.exe".
It would execute the game.
Basically it acts as if the user has just double clicked on the file.
I have tried the following, but to no success. ("CreateProcess error=193, %1 is not a valid Win32 application")
Thanks for the help.