How to Create a Windows batch file to run "Other Sage 100 ERP Task Outside the Program"

KB article 19387 "How to create a short-cut or Windows batch file to run Visual Integrator import job, export job, or other Sage 100 ERP task outside the program," implies this can be done but the examples given are for VI jobs only, where the "APP Name" and "Compiled VI Name" are readily available on the VI Job Maintenance screen.

Can the same bat file format be used to run tasks other than VI, ie, launch "Daily Sales Reports/Updates" or "Production Register Update" and if so, where can I find the corresponding "APP Name" and "Compiled Name"?

  • 0

    I don't believe you can do that from a batch file.  You have to create a VB Script to use BOI and create the objects.  I have done something similar with a VB script that calls the batch file for the VI.  The other challenge is waiting until the VI job is done before running other tasks.  There doesn't seem to be a good way to do that.  You are probably better off scheduling them separately - run the batch file for the VI job, then 15 minutes later run the VBScript to run the registers.

  • 0 in reply to hyanaga

    Odd that the KB article implies it can be done or am I misreading it?  In any case, would you mind sharing with me the script you created to run the registers?  Would be greatly appreciated.

    Thanks for your speedy reply.

  • 0

    Sage task scheduler can do auto-posting... and you can trigger scheduled tasks (once configured / working) from a batch file.

    Some things may be technically possible but are too complicated for anyone but master developers to deal with.

  • 0 in reply to Kevin M

    Can you provide some sample code for the bat file or direct me to where I might get more information?  Thanks.

  • 0 in reply to ehx

    Google how to start a scheduled task from a batch file.  That is the easy part.  Task Scheduler auto posting can be tricky to get working at all.

  • 0 in reply to ehx

    Following KB 19387, I've successfully created three individual bat files to run > (1) VI Import, (2) Launch Production Register, and (3) Launch Daily Sales Reports/Updates.  Each of the bat files works perfectly when executed individually.  However, when I create 4.bat to Call each of the three previous bat files in sequence, only the first job runs and 4.bat ends.  Looks like control is not being transferred back to 4.bat after the first job completes.  Any ideas how to return control to 4.bat so execution can continue?  Code for VI Import bat file below:

    C:

    CD "C:\Sage\Sage 100 Workstation\MAS90\Home\"


    "C:\Sage\Sage 100 Workstation\MAS90\Home\pvxwin32.exe" -hd ../launcher/sota.ini *Client -ARG "server" "1234" "Production Register Update" -ARG= DIRECT UION user pword TES VIWI1B DISPLAY

  • 0 in reply to ehx

    VI jobs triggered from a batch file do not wait until the job is finished before starting the next step in the batch file.  Use a /TIMEOUT or set up an alternative way to pause the batch file until the import is done.

  • 0 in reply to Kevin M

    Timeout is not the problem.  4.bat below >

    Call bat1  (see sample code in previous post.  bat2 and bat3 are similar to bat1)

    Call bat2

    Call bat3

    When I launch 4.bat it executes bat1 and ends.  How do I get control back to 4.bat to continue execution of the other 2 Calls?

  • 0 in reply to ehx

    It should happen immediately without delay, unless you put in a timeout.