Search code examples
trace32lauterbach

How to run a .bat file from a TRACE32 script?


I need to run a .bat file from a TRACE32 script.

I tried with OS.FILE.ACCESS("name of file","x") where x represents X execute file.

In the manual it says that this function returns TRUE or FALSE, so I executed PRINT OS.FILE.ACCESS("FILENAME","x") but I only receive TRUE, the .bat file isn't executed.

Is there a posibility to execute a .bat file from a TRACE32 script ?


Solution

  • Depending on what you actually want to do, one of the following commands should be suitable to run any external program or batch file:

    • OS.Area <cmdline> Output in AREA window (blocking)
    • OS.Window <cmdline> Output in "OS.Window" window (blocking) inside PowerView
    • OS.screen <cmdline> On Windows the command gets directly executed without a shell. The output of a console application is shown in a temporary command window. / On Linux the output is in the shell, which started the TRACE32 GUI (non-blocking)
    • OS.Hidden <cmdline> No output anywhere (blocking)
    • OS.Command <cmdline> Output in system shell, which allows redirects (non-blocking on Windows / blocking on Linux unless you add an ampersand &)

    I'd suggest command OS.Command <cmdline>

    The Function OS.FILE.ACCESS() is indented to check if you have read/write or execution rights for a file.