Create a Command Line Integration
There are five steps required to schedule a command line integration:
1.      Create a Dynamics GP Login Macro.
2.      Create a .BAT file to launch Dynamics GP.
3.      Create a .BAT file to run an Integration.
4.      Create a .BAT file to run the previous two .BAT files J
5.      Create a Scheduled Task.
 
Create a Dynamics GP Login Macro
Dynamics GP must be running before an integration that uses the Dynamics GP Adapter can be performed. The login macro logs into Dynamics GP in the same way that a user logs in. There are five steps to create the login macro.
1. Start Dynamics GP, but do not log in.
2. Begin recording the macro. At the Welcome window, press ALT-F8 to begin recording the login macro. Name the macro and save it in a known location.
3. Complete logging into Dynamics GP; be sure to manually type any User ID and Password information so this information is captured by the macro. Keep in mind that the password in the macro
may be a security issue.
4. Stop recording the macro. Once logged into Dynamics GP, stop recording the macro by pressing ALT-F8.
5. Edit the macro. Edit the macro using a text editor such as Notepad to insert the following as the second line of the macro:
Logging file ‘macro.log’ (include the apostrophe)
Adding this line prevents messages from being displayed by the macro as it is running. Instead, any messages are written to the MACRO.LOG file.
 
Create a .BAT file to Launch Dynamics GP
To start Dynamics GP from the command line, the location of the following files must be supplied:
 
·         Dynamics GP Runtime Engine (Dynamics.exe)
·         Dynamics GP Launch File (Dynamics.set)
·         Login macro
 
Within a text editor program such as Notepad, create a file that contains the following information:
"C:\Program Files (x86)\Microsoft Dynamics\GP2010\Dynamics.exe" (space)
"C:\Program Files (x86)\Microsoft Dynamics\GP2010\Dynamics.set" (space)
"C:\Program Files (x86)\Microsoft Dynamics\GP2010\Login.mac"
 
The lines are defined as follows:
·         "C:\Program Files (x86)\Microsoft Dynamics\GP2010\Dynamics.exe"- where the Dynamics GP runtime file is located.
·         "C:\Program Files (x86)\Microsoft Dynamics\GP2010\Dynamics.set" - where the Dynamics GP launch file is located.
·         "C:\Program Files (x86)\Microsoft Dynamics\GP2010\Login.mac" - where the login macro file is located.
·          
Once the file is saved, rename it Login.bat.
 
Create a .BAT file to Run an Integration
To start an integration from the command use the Integration Manager Runtime Engine (Microsft.Dynamics.GP.IntegrationManager.IMRun.exe) file. Within a text editor like Notepad, create a file with the following contents:
 
"C:\Program Files (x86)\Microsoft Dynamics\Integration Manager 11\Microsoft.Dynamics.GP.IntegrationManager.IMRun.exe" /I
[Name of Integration] OR /G [Integration Group] /S
 
The contents are defined as follows:
 
•"C:\Program Files (x86)\Microsoft Dynamics\Integration Manager 11\Microsoft.Dynamics.GP.IntegrationManager.IMRun.exe"- The
location of the Integration Manager runtime file.
 
• /I [Name of Integration] - Indicates the name of the integration to run. If the name contains spaces, enclose it in quotation marks, for example /I “Customer Import”.
 
• /G [Integration Group] - Indicates the name of the integration group to run. If the name contains spaces, enclose it in quotation marks, for example /I “Financial Integrations”.
 
• /S - Indicates that the integration runs without displaying the progress dialog. 
 
NOTE:  either an integration (/I) or an integration group (/G) can be run, but not both. Therefore, the file must only contain one of the commands.
 
After saving the file, rename it to IMRUN.bat.
 
Create a .BAT file to run both batch files
 
Within a text editor like Notepad, create a file named RUN_Integration.bat with the following contents:
 
[pathname] Login.bat
[pathname] IMRUN.bat
 
Create a Scheduled Task
 
There are multiple ways to create a scheduled task:
1.      Click Start, point to Programs, point to Accessories, click System Tools, and then click Task Scheduler.
2.      Click Start, click Control Panel, and then click Administrative Tools and then click Task Scheduler.
3.      Using Windows 7 the window looks like this:
NOTE: To shut down Dynamics GP after a successful integration a tool called AutoDim is available from Dynamics GP professional services. It costs around $500 in total (not per user).
I hope this helps!
Kind regards,
Leslie