Is there more documentation on the system() function as it applies to Windows OS? Here’s all that I can find in the help files:
• system("start /b program") starts without DOS window in the background under Windows.
• system("cmd /c program") starts synchronously but in a DOS window
• system("start cmd /c program") starts asynchronously but in a DOS window. Thus, they can only be used under Windows.
• Windows programs not in the path can be launched with system ("cmd /c start ")!
This information is rather vague. For instance, I would like to run a command/program in the background (without a window) synchronously. How do I do that?
I assume “cmd” launches the program in a dos window. What’s the difference between “/b” and “/c”? And why is "start cmd /c program" different from "cmd /c start "? Is the order of the keywords really flexible and important? What exactly does the "start" keyword do? What's the difference between "background" and "synchronous/asynchronous"?
system() function on Windows OS
- kilianvp
- Posts:443
- Joined: Fri Jan 16, 2015 10:29 am
Re: system() function on Windows OS
START runs asynchronously (the batch file executes the next line immediately).
CMD /C runs synchronously (the batch file does wait until the called command was finished).
CMD /C runs synchronously (the batch file does wait until the called command was finished).
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: system() function on Windows OS
The system() command in WinCC OA gives you the possibility to start an program, batch file, ....
The syntax used for the command depends on the command/program you want to start.
You can also start a program by addressing the absolute path: system(/);
If the directory where the program is located is included in the PATH environment you can simlpy call the program: system();
Best Regards
Leopold Knipp
Senior Support Specialist
The syntax used for the command depends on the command/program you want to start.
You can also start a program by addressing the absolute path: system(/);
If the directory where the program is located is included in the PATH environment you can simlpy call the program: system();
Best Regards
Leopold Knipp
Senior Support Specialist