0

I'd like to use LaunchExternalProcess to trigger opening html file in GMS. I have tested the command in cmd, and it works. The cmd command is

start X:\Manual\index.html

But if I use the code below in GMS, it will say it can't file the file

String cmd = "start X:\\Manual\\index.html"
LaunchExternalProcess(cmd)

1 Answer 1

1

Try

string msg = "cmd.exe /c" 
msg += "start C:/temp/test.htm"
LaunchExternalProcess(msg)

Note that the LaunchExternalProcess() command is not the same as being within the command prompt. It is rather like running a link-icon, i.e. one specifies the executable to run.

The "start" command is a command within the command prompt, not an executable. So one has to "launch" the command prompt (/c to not show the window) and pass the command prompt's command as a parameter of that call.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.