web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How to Schedule a Macro using Windows Server 2008 Task Scheduler?

(0) ShareShare
ReportReport
Posted on by 6,775

I have set up a BAT file to run a Macro. The BAT files runs fine when I double click / open the BAT file.

However, when I set up the BAT file with Task Scheduler, it does not run. It is 'running' but GP does not launch and the Macro does not run.

I have checked the History log for the file but it only indicates that the Macro ran and stopped. (It stopped because I set it up to stop running if the process took longer than 30 minutes.)

I have tried setting it up with the Task Scheduler using a BAT file and a CMD file. Both do not work.

Does anyone have any suggestions?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Hi R1012 !

    Are your keeping a desktop session logged in your server (or workstation) when preparing the schedule ? Dynamics GP cannot run without a user context...

    I do this weekly on my GP server to run reconciles unattended in 3 different companies. Though I don't use the Windows built-in scheduler because I find out cumbersome to manage, you can grab free tools that do the same much more convienently (i.e. SystemScheduler from Splinterware).

  • Renee Leung Profile Picture
    6,775 on at

    Yes here's what I've tried:

    - with the user logged in, the option to run only when user is logged on, is selected.

    - with user logged off, the option to run whether user is logged on or not, is selected.

    I've got the Macro to run where GP will launch and log in but it takes a long time and stalls so the Macro is not fully run.

    I noticed when I had it run overnight with the option for user to be logged off/on to run, task scheduler started multiple instances of Dynamics GP.

  • Renee Leung Profile Picture
    6,775 on at

    I found a post that said that Windows Task Scheduler can't run a GP Macro automatically if using Windows Server 2008 and Vista. I'm currently using Windows Server 2008 R2. Is there any way around this?

    I noticed that when I'd run the Macro (with option to run when user is logged on), the Macro stalls and stops at the Login page. The version requirement might explain this. Anyone have ideas on workarounds?

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    I use Windows 2008R2 64-bit and SQL 2008R2 as well... I'm using SystemScheduler from Splinterware, so if your IT dept doesn't see any issue, I would give it a try and get away from the windows Scheduler.

    Also a basic rule is that your job will never work if you're not able to run successfully the macro in an interactive GP session yourself... If the macro doesn't work properly when executed manually, they forget about even trying unattended...

    if you don't mind, you can send me the macro file so I can have a look at it... my e-mail is in the profile.

  • Renee Leung Profile Picture
    6,775 on at

    Thanks Beat! I tried the System Scheduler you recommended and it worked fine on first try (unlike the Task Scheduler). One question, can the system scheduler run when you're logged off or do you need to remain logged in?

  • Verified answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Glad it worked :-).  You'll have to leave the desktop session for a user open (but it can be locked, no problem for the scheduler), otherwise your GP Client will never start... remember that it can only run in a user-context environment... The GP client is not made to be run out of user-context... After all, it's an interactive application first, the fact that you can run some tasks with the help of macros doesn't make the application an automated system :-). Don't forget to give your desktop user full permissions to execute properly an application and that the GP client needs to be run with Admin privieges (depending on your OS version).

    Good luck.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
mtabor Profile Picture

mtabor 1

#2
Victoria Yudin Profile Picture

Victoria Yudin 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans