It is sometimes needed to call a system command or a command script from a BusinessWorks process. This is possible using the ‘External Command’ activity but there are a few useful things to know.
This article aims to explain how to use the ‘External Command’ activity in a Windows Environment.
# Windows environment
To call a basic command like ‘DIR’ the External Command activity should be configured with following options.
1. Check the ‘Provide Command Output’ to get the output of the command :
![1*cgWUa2bvK971h8HCkHOVtw.png](https://miro.medium.com/v2/resize:fit:421/1*cgWUa2bvK971h8HCkHOVtw.png)
2. In the Input tab map the command field with a string containing the command and its parameters (note that it should start by ‘cmd /c’):
![1*t6pSQw15LFx1Cg4eJVf_zg.png](https://miro.medium.com/v2/resize:fit:605/1*t6pSQw15LFx1Cg4eJVf_zg.png)
The same approach can be used to start a batch script:
![1*7iqCPod89VPPmrrRnLwu-A.png](https://miro.medium.com/v2/resize:fit:605/1*7iqCPod89VPPmrrRnLwu-A.png)
# Linux environment
To call a basic command like ‘ls’ the External Command activity should be configured with following options.
1. Check the ‘Provide Command Output’ to get the output of the command :
![1*kKTWmitcF5rOEzlumQH0nA.png](https://miro.medium.com/v2/resize:fit:414/1*kKTWmitcF5rOEzlumQH0nA.png)
2. In the Input tab map the command field with a string containing the command and its parameters (if the command or its parameters never change it can be entered in the ‘Command To Execute’ field) :
![1*WEks2zkdZq1k-lkhq0I7uQ.png](https://miro.medium.com/v2/resize:fit:643/1*WEks2zkdZq1k-lkhq0I7uQ.png)
A batch script can be launched using the same approach:
![1*A6tYV3heETEwfxdAyKgoEQ.png](https://miro.medium.com/v2/resize:fit:700/1*A6tYV3heETEwfxdAyKgoEQ.png)
Reference elements
-
1
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now