Have a Question?
Print

SCALL examples for VPRO/5 and BBj

  1. 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?

 

  1. 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 are 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:

SETOPTS

8 $08$ In BBj 4.0 and higher, ENV(), INFO(4,*), and SCALL (except SCALL(“bbj”)) refer to the CLIENT.  

In BBj 12.0 and higher, TIM, JUL(0,0,0), and DATE(0,…) use the client-side date and time when this bit is set.

When using SCALL() to access OS level commands or executables you may need to provide a full path to the executable.

In cases where your SCALL() uses pipes for redirection or needs to expand wildcards using the .getRuntime().exec() method might be a better option.

Runtime.getRuntime().exec(“cmd.exe /c dir c:\bbx\log\* > c:\bbx\log\filesize.txt”)


Last Modified: 02/15/2023               Product: Licensing           Operating System: N/A

Table of Contents
Scroll to Top