Skip to content
logo Knowledgebase

How to create a short-cut or Windows batch file to run a Visual Integrator import job, export job, or other Sage 100 ERP task outside the program

Created on  | Last modified on 

Resolution

CAUTION: Sage Customer Support cannot assist with issues related to third-party products or enhancements, hardware, report customizations, state or federal tax-related questions, or specific accounting questions. Refer to our Scope of Support document for details. For assistance, contact your Sage business partner, network administrator, or accountant. 

 

 

How to create a short-cut or Windows batch file to run a Visual Integrator import job, export job, or other Sage 100 task outside the program

 

*** Sage 100 Advanced and Premium only, or Sage MAS 200 versions 4.40.0.4 and higher ***

The Sage 100 Application Server must be used to run the Visual Integrator jobs (or other such tasks) externally from a workstation client using a batch (.bat) file so that the ODBC path to the Sage 100 server is not modified, causing Sage 100 to fail to launch certain tasks.

First there is information needed from Import or Export Job Maintenance to create the Shortcut, Batch or new APP item properly later in thes instructions

  1. Open Import Job Maintenance or Export Job Maintenance depending on the job that will be used for this new shortcut or batch file
  2. Select the Job Name or create a new Job Name for this VI Job
    1. Note the Job Name given
  3. Proceed with opening the Import or Export Job
    1. Look to the upper right corner of the Import or Export Job Maintenance screen where it says Compiled File Name
    2. Note the Compiled File Name given (VI Program Name) i.e. VIW###

 

After completing steps below to add to APPS tab of Application Server Configuration is will be necessary for all users to exit Sage 100 to complete the creation of the APP. Application Server Configuration can be used to stop the program if running as an application on the Server tab then restarted. If running Sage 100 as a Service then use Windows Services to stop the service and restart.

Next the APPS tab in Application Server Configuration will be used to create a new link to the Job to be ran. This in conjunction with the Batch or Shortcut that will be used together when executing the job.

 

How to create the new item on the APPS tab of Application Server Configuration program on the Server

  1. These steps are to be performed at the Sage 100 Advanced server
  2. From Windows, Start, Sage, Sage 100 (version) directory do the following:
  3. Open Application Server Configuration.
  4. Click on Apps tab
  5. Click on New button. The screen New - App Props for Server: "SAGE" will open
  6. Enter the Job Name given when the Job was created in Import of Export Job Maintenance. Should have been noted in first steps of this article.
    1. Note: The 'App Name' will be referenced in the batch file to execute the VI Job or similar task so it MUST match
  7. Enter the following values
    1. ProvideX EXE: leave <default>
    2. Server INI: Enter ..\Launcher\Sota.ini
    3. Lead Program: Enter StartUp.M4P
    4. Leave the Extra CMD Options and Arguments fields blank
    5. Start-In Directory: Enter the path to the ..\MAS90\Home folder from the Sage 100 Advanced server's perspective. (Note: It will be same as in Sage 100 Start-in Directory)
    6. Init Window: Select Hidden
    7. In the Options section, select "Allow Client Arguments" . The rest of the options must be unchecked.
  8. Click OK to close the New - App Props for Server: "SAGE" screen Click Apply button to save the new Application Name settings in Application Server Configuration.
  9. To verify settings once saved highlight the existing Sage 100 item listed on the APPS tab and click on Detail button and compare to the new item created. Providex EXE: thru Init Windows should be identical for both
  10. For this item to be usable all users must exit Sage 100 so the Service or Application can be stopped and started again on the server

 

How to create Batch command string or Shortcut command string. Pathing used in the string will be based on the user's Workstation installation path not the server's

<s

There are 3 lines in the batch file. Use the following steps to create the batch file:

 

Open Notepad in Windows

Right-click Sage 100 ERP shortcut on workstation and select Properties

Copy the entire path from the Start in directory and paste into Notepad. This will be Line 2

Insert CD followed by a space at the beginning of Line 2 so it looks similar to this:

 

CD "C:\Sage\MAS 200 Client\Version4\MAS90\HOME"

 

For Line 1 - Enter the Drive letter followed by a colon that is found in Line 2. Our first 2 lines should look similar to this:

 

C:

CD "C:\Sage\MAS 200 Client\Version4\MAS90\HOME

 

To create the 3rd line, copy the entire path in the Target folder. It should look similar to this:

 

"C:\Sage\MAS 200 Client\Version4\MAS90\HOME\pvxwin32.exe" ../launcher/sota.ini *Client -ARG "SERVER1" "10000" "MAS 200"

 

Make the following adjustment to Line 3: insert -hd after pvxwin32.EXE". Line 3 should now look similar to this:

 

"C:\Sage\MAS 200 Client\Version4\MAS90\HOME\pvxwin32.exe" -hd ../launcher/sota.ini *Client -ARG "SERVER1" "10000" "MAS 200"

 

Replace the Application name with the name used in VI and on the APPS tab of Application Server Configuration. This is listed after the Port number. Line 3 should now look similar to this:

 

"C:\Sage\MAS 200 Client\Version4\MAS90\HOME\pvxwin32.EXE" -hd ../launcher/sota.ini *Client -ARG "SERVER1" "10000" "VIIMPORTJOBNAME"

The remainder of Line 3 needs the following:

 

-ARG= DIRECT UION UserLogon Password Company VIWxxx AUTO.

No Spaces are used here -ARG=DIRECT

VIWxxx=compliled VI name found in upper right corner of job in Maintenance

UserLogon=Sage 100 user logon that has permissions to run VI Job

Company= Company Code to be used for VI Job

 

 

Line 3 should now look similar to this:

 

"C:\Sage\MAS 200 Client\Version4\MAS90\HOME\pvxwin32.EXE" -hd ../launcher/sota.ini *Client -ARG "Server Name" "Port" "App Name" -ARG= DIRECT UION John Doe ABC VIWI00 AUTO

 

The batch file should now be complete and look similar to the following:

 

C:

CD "C:\Sage\MAS 200 Client\Version4\MAS90\HOME"

"C:\Sage\MAS 200 Client\Version4\MAS90\HOME\pvxwin32.EXE" -hd ../launcher/sota.ini *Client -ARG "Server Name" "Port" "App Name"-ARG= DIRECT UION John Doe ABC VIWI00 AUTO

 

Save the Notepad file with an extension of .bat to create the batch file. Double-click the batch file to execute the file.

 

Actual Example String:

C:
CD "C:\Sage\Sage 100 Workstation\MAS90\Home\"
"C:\Sage\Sage 100 Workstation\MAS90\Home\pvxwin32.exe" -hd ../launcher/sota.ini *Client -ARG "CAI514866" "10000" "SOINVOICEIMP" -ARG=DIRECT UION admin password ABC VIWI00 AUTO

 

*** Sage 100 Standard only, or MAS 90 versions 4.00 and higher, or MAS 200 versions 4.00 to 4.40.0.3 ***

  1. Verify that the task exists as a menu item that can be given access in Role Maintenance.
  2. Verify that Visual Integrator jobs exist on the Jobs Menu.
    1. Note: This is automatic for jobs importing into modules upgraded to level 4 standards, but must be added manually if the job imports into legacy modules.
  3. Give the user logon access to the menu task in Role Maintenance. For more information, see the DocLink below. 

 

Create a command line with the following information:

Note: Enter all text in the case indicated. Some arguments are case sensitive.

..\MAS90\Home\Pvxwin32.exe ..\launcher\sota.Ini ..\SOA\Startup.M4P -ARG DIRECT (UI State) (User Logon) (Password) (CompanyCode) (Program Name) (Program Argument)

Example:

..\MAS90\Home\Pvxwin32.exe .. \Launcher\Sota.Ini ..\SOA\Startup.M4P -ARG DIRECT UION user1 password01 ABC VIWI00 AUTO

 

Notes:

  • If a field in the argument is not needed (for example, passwords are not used), enter "" (two quotes) as a placeholder.
  • Enter the user logon from the User Logon field in User Maintenance, not the User Code field.
  • Set UIState to either UION or UIOFF. This setting specifies whether there will be any user interface. For example, whether the user will receive error notifications in a message box.
  • Set Program Argument to AUTO or MANUAL. Note: AUTO must be uppercase or the interface will still display.
  • The manual option displays the interface for the import job and requires the user to click Accept. Use the manual option for testing purposes before using Auto.
  • Use AUTO for the program argument after verifying that the job is successful using the manual option.
  • If the command line is run in a batch file (for example, Jobs.bat), enter the command similar to the following: Note: The current directory is first set to ..\Mas90\Home before running the command, and the program argument is initially set to MANUAL.

    F:
    CD F:\Version4\MAS90\Home
    Pvxwin32.exe .. \Launcher\Sota.Ini ..\SOA\Startup.M4P -ARG DIRECT UION myuser mypassword ABC VIWI00 MANUAL

  • If a mapped drive letter is used, make sure the drive letter is mapped to a directory above the "..\MAS90" directory where Sage 100 ERP (or MAS 90/200) is installed, not to the "..\MAS90" directory itself.

 

Additional information

 

When running a Visual Integrator job, the source file (name and location) is designated in Import Job Maintenance. It is not possible to specify the source file in the shortcut.

 

 

DocLink: How to setup user Roles and set up security and permissions for users to access tasks and options in Role Maintenance for Sage 100

Need more help?

Chat now