System.util.execute Show Cmd Window

How to I get the CMD window to pop up when running a cmd file in system.util.execute? i.e. system.util.execute(["C:\Cmds\StartSAPDnLd.cmd"])?

Where (in what scope) are you running this script?

In a script on a Vision Push Button.

Try something like:

system.util.execute(["cmd", "/k", "start", "C:/Cmds/StartSAPDnLd.cmd"])

Awesome! That worked. I looked all over the place for the Commands/arguments for system.util.execute, where are they documented? Like where can I find where "cmd", "/k", "start", means? Thanks again.

system.util.execute doesn't have any functionality built in. All it does is ask the underlying operating system to run some program (the first argument) with some arguments (the remaining arguments). So you're invoking the Windows builtin cmd.exe with /k start someFile as the arguments.
The /k flag is documented here: cmd | Microsoft Learn

1 Like

Thanks, that explanation makes it pretty easy to understand.