|
Post by James Grubbs (Jimmy) on Apr 2, 2019 17:45:17 GMT -5
I would love to see the RUN command be able to choose the Windows Default App for executing known file extensions rather than having to define what App to use manually. Not a great big deal as there are other ways to accomplish this of course but that would make life a bit easier if it could be done.
|
|
|
Post by Chris Iverson on Apr 2, 2019 18:20:17 GMT -5
Using the ShellExecute() API would be the best choice for this, as the suggestion I'm about to give isn't actually officially documented or supported by Windows/Microsoft, but a quick workaround is to use explorer.exe as the run target.
run "explorer.exe test.txt"
Will open a text file in the user's default editor(often Notepad).
run "explorer.exe test.html"
Will open the file in the user's default browser.
In some cases, you might need to be sure to specify the full path, but for the most part, it should work.
|
|
|
Post by James Grubbs (Jimmy) on Apr 3, 2019 13:49:41 GMT -5
I forgot all about that. I just recently had a need and had been years since the last time I used explorer.exe. That is exactly what I needed. Thanks Chris.
|
|