KB - SCALL() Examples for VPRO/5 and BBj
Q. I am on Windows 7 and I am having trouble figuring out how to execute a batch file from my VPRO/5 application with SCALL(), can you give me some examples?
A. You need to pass the Windows command prompt with a few parameters for this to work.
x=scall("cmd /c start C:/workarea/test.bat") Note: the cmd /c start is needed by the OS
When running BBj one needs to consider the client / server aspect of where that SCALL() is going to take place.
If you running BBjServices as a service under Windows, you will never see the program running, because the SYSTEM user has no permissions to display to the screen.
If the client and server are two different machines:
scall will show the program on the server and the client will never see it.
BBj also offers the clientExec() method of executing a command on the client. The clientExec() will fail if the program does not reside on the client.
BBj offers a SETOPTS byte/bit setting for running client side:
When using SCALL() to access OS level commands or executables you may need to provide full path to the executable.