Open file with standard application?

Just starting out? Need help? Post your questions and find answers here.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Open file with standard application?

Post by Lebostein »

On Mac OS X I can do this:

Code: Select all

RunProgram("open", "/Applications/PureBasic.app/Contents/Resources/examples/sources/Data/Background.bmp", GetCurrentDirectory())
On Windows I tried this, but it don't work:

Code: Select all

RunProgram("start", "c:\Program Files\PureBasic\Examples\Sources\Data\Background.bmp", GetCurrentDirectory())
In PowerShell it works (but not with cmd.exe):

Code: Select all

start "c:\Program Files\PureBasic\Examples\Sources\Data\Background.bmp"
Any hints for me? Thanks!
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Open file with standard application?

Post by BarryG »

Do it like this for Windows:

Code: Select all

RunProgram("c:\Program Files\PureBasic\Examples\Sources\Data\Background.bmp")
Post Reply