Difference between Run () and ShellExecute ()

I want to execute something in a shell / terminal on Windows via AutoIt. And I know that there are two ways to do this. For instance:

Run(@ComSpec & " /c " & $myCommand, "", @SW_HIDE) ;and ShellExecute($myCommand) 

I do not understand the difference; both functions will do what I want, but what is behind them? What pros and cons do they have?

+4
source share
1 answer

Run() used to run only executable files. This requires the full path to the program.

ShellExecute() also accepts content files such as .txt, .htm, and .docx and runs the associated executable. The verb parameter can be used to control the actions performed in the file. It uses the Windows ShellExecute API .

References:
AutoIt Wiki - FAQ - How can I run something that is not an exe file ...

+3
source

All Articles