Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

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

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

  • Verified answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    Re: How to Schedule a Macro using Windows Server 2008 Task Scheduler?

    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.

  • Renee Leung Profile Picture
    Renee Leung 6,775 on at
    Re: How to Schedule a Macro using Windows Server 2008 Task Scheduler?

    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?

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    Re: How to Schedule a Macro using Windows Server 2008 Task Scheduler?

    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
    Renee Leung 6,775 on at
    Re: How to Schedule a Macro using Windows Server 2008 Task Scheduler?

    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?

  • Renee Leung Profile Picture
    Renee Leung 6,775 on at
    Re: How to Schedule a Macro using Windows Server 2008 Task Scheduler?

    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.

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    Re: How to Schedule a Macro using Windows Server 2008 Task Scheduler?

    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).

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans