Batch File Runner Script

The Batch Filer Runner (BATCH_FILE_RUNNER) is a system library HyperPoint that can be used by different batch file runner script instances. A script library file called BATCHFILERUNNER_SCRIPT.TXT can be configured to run a batch file at a specified interval or when triggered by a referenced point. The script for the BATCH_FILE_RUNNER Library HyperPoint is stored in the CygNet\Utilities\SCRIPTLIBRARY folder on your host server. The library point is installed using the CygNet Point Script Copy Utility.

For more information, see the following subsections below:

Create the BATCH_FILE_RUNNER Library HyperPoint

The system library BATCHFILERUNNER_SCRIPT.TXT contains the script required to run a batch file.

To Install the Batch File Runner Script

  1. Using Windows Explorer, browse to the CygNet\Utilities directory on the host server.
  2. Locate and double-click the CygNet Point Script Copy Utility program executable (PointCfgScriptCopy.exe).
  3. In the PointCfg Service drop-down menu, select the Point Service (PNT) to which you want to copy the script.
  4. In the Target HSS Service drop-down menu, select the HyperPoint Scripting Service (HSS) to which you want to copy the script.
  5. In the Script Copy Source (Copy From) area, select the From File option.
  6. Click the Browse button beside the From File field and browse to the directory that contains the BATCHFILERUNNER_SCRIPT.TXT file. This is typically CygNet\Utilities\ScriptLibrary.
  7. Select the BATCHFILERUNNER_SCRIPT.TXT file and click Open.
  8. In the Script Copy Target (Copy to) area, select To Default Service Point in Source.
  9. Click Test Copy to validate the copy. Closely read all test messages and resolve any errors before proceeding.
  10. If you are ready to perform a live copy, click Perform Copy to copy the script into the selected PNT and HSS.
  11. Click Yes if you are sure you want to copy the selected script. A new Library HyperPoint is created.
  12. In the HSS in CygNet Explorer, right click the newly created Library HyperPoint and select Point Configuration from the drop-down menu.
  13. Click Edit and ensure that the HyperPoint and Activate Script check boxes are selected on the General tab.
  14. Click Save.

Create the Library User HyperPoint

A Library User HyperPoint must be created to run the Batch File Runner script.

Library User HyperPoint

Library User HyperPoint

To Create a Library User HyperPoint

  1. Using CygNet Explorer, open the Point Service (PNT) in the service hierarchy.
  2. Right-click in the white space in the PNT service pane and click New.
  3. In the Site.service field, click and select your HSS.
  4. In the Facility ID field, type the Facility ID name or click to select the appropriate facility.
  5. In the Uniform data code box, type the UDC name or click to select the appropriate UDC.
  6. Ensure that the HyperPoint and Activate Script check boxes are selected.
  7. Set the Point Type to String Input.
  8. Select the HyperPoint page.
  9. Set the HyperPoint type to Library User HyperPoint.
  10. Click the Use library HyperPoint field browse button and select BATCH_FILE_RUNNER.
  11. On the Point reference page, in the External ID property, type the path to the file or application you want to run.
  12. To configure the batch file to run on an interval, enter the number of milliseconds in the General 1 data field on the Application page.
  13. To configure the batch file to run when a point value changes, enter the value in the General 2 data field on the Application page.
  14. To configure the batch file to run on a trigger point, select the Point Reference page and perform the following:
  1. Click the Choose point button, change the CVS Site.Service to your UIS, and refresh the view.
  2. Select the desired point.
  3. If you want the batch file to run when the trigger point matches a specified value, enter the matching value in the trigger point’s General 2 data field on its Application page.
  4. Note: If step c. is not performed, the batch file will run on any/every change to the trigger point.

  1. Click Save. The Library User HyperPoint value displayed indicates the script’s running status.

Point Reference page

Point Reference page

Back to top

The following table lists and describes the possible values of the script's running status.

Value Description
Bad Timer Value The specified timer interval is invalid.
Bat File Failed There was an error running the batch file.
Initialized The HyperPoint has finished initialization.
No Batch File No batch file has been specified.
No Timer/Tag There is no timer or trigger tag specified.
No Val Match The trigger point is not set to the matching value to activate the batch file.
Success The batch file run was successful.
WScript Shell Crt The script failed to create the Windows Script Shell object.

Troubleshooting

Perform the following steps if the script fails to run:

  1. Check the value of the Library User HyperPoint in the HSS for an error message.
  2. Use CygNet Console to check HSS system messages. If the console shows an error on a specific line, use Notepad to open the Script.txt file (stored in the CygNet\Services\HSS folder).
  3. Check the HSS_Script<xxx>.log in the CygNet\Services\HSS folder for errors.
  4. Ensure that the LOGMASK_SCRIPT keyword in the Hss.cfg file is set to LOG_ALL.

Perform the following steps to verify the settings of the trigger point:

  1. Verify the Point ID of the trigger point on the Point reference page of the Library User HyperPoint.
  2. Verify the path to the batch file on the Point reference page of the Library User HyperPoint.

Back to top