Andrea Raimondi 13 Posted November 13, 2020 Hi! I know the code from Jim to open URLs, for example, but I am more looking for something like ShellExecute on Windows but cross platform. Any ideas? Thanks! Share this post Link to post
Remy Lebeau 1398 Posted November 13, 2020 There is no cross-platform way to open a path/url. Every platform has different requirements, so you need platform-specific coding. 1 Share this post Link to post
Wil van Antwerpen 25 Posted November 14, 2020 There are many ways, lots of different nuances on exactly how you want to execute something on the different platforms. Having said that. the following is probably close to what you are asking for: class procedure TShell.Open(sCommand: string); begin {$IFDEF MSWINDOWS} ShellExecute(0, 'OPEN', PChar(sCommand), '', '', SW_SHOWNORMAL); {$ENDIF MSWINDOWS} {$IFDEF POSIX} _system(PAnsiChar('open ' + AnsiString(sCommand))); {$ENDIF POSIX} end; Share this post Link to post