Results 1 to 15 of 15

Thread: Using Windows Server 2008 Task Scheduler to Run a Macro

  1. #1
    childofthe1980s Guest

    Using Windows Server 2008 Task Scheduler to Run a Macro

    Hello:

    Sigh..........I spent the whole day configuring macros to run a program.
    When I run each macro through the shortcut that I configured for each one,
    they run perfectly.....PERFECTLY!

    But, the Windows Server 2008 Task Scheduler does not like something. I need
    to use task scheduler unfortunately to run these macros overnight, otherwise
    the work that I spent a whole Sunday conducting is worthless.

    My guess is that it is the Actions tab of the Basic Task in Windows
    Scheduler does not understand the shortcut that runs my macro. Here is the
    path for one of the shortcuts:

    "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP Macros\GP
    Login_CSI.mac"

    So, when it did not work the first time, I split up the shortcut path into
    the following: "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe"

    Then, at the same time, I told the Action tab to run this as an additional
    argument:
    "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP
    Macros\GP Login_CSI.mac"

    Finally, I told it to "Start In" here:"C:\Program Files\Microsoft
    Dynamics\GP$DYNGP"

    Still, no success.

    Anybody got any ideas? In any case, this is ridiculous. Previous versions
    of the Task Scheduler were not nearly this hard to run.

    childofthe1980s

  2. #2
    Dave Patrick Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Can you run it from the command line? If so you should be able to wrap it up
    in a CMD file and schedule the *.cmd file to run.


    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect


    "childofthe1980s" wrote:
    > Hello:
    >
    > Sigh..........I spent the whole day configuring macros to run a program.
    > When I run each macro through the shortcut that I configured for each one,
    > they run perfectly.....PERFECTLY!
    >
    > But, the Windows Server 2008 Task Scheduler does not like something. I
    > need
    > to use task scheduler unfortunately to run these macros overnight,
    > otherwise
    > the work that I spent a whole Sunday conducting is worthless.
    >
    > My guess is that it is the Actions tab of the Basic Task in Windows
    > Scheduler does not understand the shortcut that runs my macro. Here is
    > the
    > path for one of the shortcuts:
    >
    > "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    > Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP Macros\GP
    > Login_CSI.mac"
    >
    > So, when it did not work the first time, I split up the shortcut path into
    > the following: "C:\Program Files\Microsoft
    > Dynamics\GP$DYNGP\Dynamics.exe"
    >
    > Then, at the same time, I told the Action tab to run this as an additional
    > argument:
    > "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP
    > Macros\GP Login_CSI.mac"
    >
    > Finally, I told it to "Start In" here:"C:\Program Files\Microsoft
    > Dynamics\GP$DYNGP"
    >
    > Still, no success.
    >
    > Anybody got any ideas? In any case, this is ridiculous. Previous
    > versions
    > of the Task Scheduler were not nearly this hard to run.
    >
    > childofthe1980s



  3. #3
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    That's a little beyond my knowledge. I'm a software consultant who was able
    to use the previous versions of Task Scheduler without going through a bunch
    of hoops.

    Do you have any documentation on how to run this from the command line and
    how to create a command file?

    childofthe1980s

    "Dave Patrick" wrote:

    > Can you run it from the command line? If so you should be able to wrap it up
    > in a CMD file and schedule the *.cmd file to run.
    >
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > Hello:
    > >
    > > Sigh..........I spent the whole day configuring macros to run a program.
    > > When I run each macro through the shortcut that I configured for each one,
    > > they run perfectly.....PERFECTLY!
    > >
    > > But, the Windows Server 2008 Task Scheduler does not like something. I
    > > need
    > > to use task scheduler unfortunately to run these macros overnight,
    > > otherwise
    > > the work that I spent a whole Sunday conducting is worthless.
    > >
    > > My guess is that it is the Actions tab of the Basic Task in Windows
    > > Scheduler does not understand the shortcut that runs my macro. Here is
    > > the
    > > path for one of the shortcuts:
    > >
    > > "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    > > Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP Macros\GP
    > > Login_CSI.mac"
    > >
    > > So, when it did not work the first time, I split up the shortcut path into
    > > the following: "C:\Program Files\Microsoft
    > > Dynamics\GP$DYNGP\Dynamics.exe"
    > >
    > > Then, at the same time, I told the Action tab to run this as an additional
    > > argument:
    > > "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP
    > > Macros\GP Login_CSI.mac"
    > >
    > > Finally, I told it to "Start In" here:"C:\Program Files\Microsoft
    > > Dynamics\GP$DYNGP"
    > >
    > > Still, no success.
    > >
    > > Anybody got any ideas? In any case, this is ridiculous. Previous
    > > versions
    > > of the Task Scheduler were not nearly this hard to run.
    > >
    > > childofthe1980s

    >
    >


  4. #4
    Dave Patrick Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Try this from the command line;

    Start|Run|cmd.exe

    "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP
    Macros\GP Login_CSI.mac"

    (this assumes dynamics.exe accepts and understands the two space-separated
    arguments)


    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect


    "childofthe1980s" wrote:
    > That's a little beyond my knowledge. I'm a software consultant who was
    > able
    > to use the previous versions of Task Scheduler without going through a
    > bunch
    > of hoops.
    >
    > Do you have any documentation on how to run this from the command line and
    > how to create a command file?
    >
    > childofthe1980s



  5. #5
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Yeah, Dave! That worked! It can run against the command line!

    Can you give me a crash course on how to create a .cmd file, now?

    childofthe1980s

    "Dave Patrick" wrote:

    > Try this from the command line;
    >
    > Start|Run|cmd.exe
    >
    > "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    > Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP
    > Macros\GP Login_CSI.mac"
    >
    > (this assumes dynamics.exe accepts and understands the two space-separated
    > arguments)
    >
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > That's a little beyond my knowledge. I'm a software consultant who was
    > > able
    > > to use the previous versions of Task Scheduler without going through a
    > > bunch
    > > of hoops.
    > >
    > > Do you have any documentation on how to run this from the command line and
    > > how to create a command file?
    > >
    > > childofthe1980s

    >
    >


  6. #6
    Dave Patrick Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    It's quite simple. Just create a file using notepad.exe, paste in the
    command (all on one line) that worked, then after you save the file rename
    it from a TXT extension to a CMD extension. That's it.


    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect


    "childofthe1980s" wrote:
    > Yeah, Dave! That worked! It can run against the command line!
    >
    > Can you give me a crash course on how to create a .cmd file, now?
    >
    > childofthe1980s



  7. #7
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Sigh.......the task scheduler is not even running the .cmd file....

    I don't know what in the world the problem is.

    childofthe1980s

    "Dave Patrick" wrote:

    > Try this from the command line;
    >
    > Start|Run|cmd.exe
    >
    > "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    > Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" "D:\GPShare\GP
    > Macros\GP Login_CSI.mac"
    >
    > (this assumes dynamics.exe accepts and understands the two space-separated
    > arguments)
    >
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > That's a little beyond my knowledge. I'm a software consultant who was
    > > able
    > > to use the previous versions of Task Scheduler without going through a
    > > bunch
    > > of hoops.
    > >
    > > Do you have any documentation on how to run this from the command line and
    > > how to create a command file?
    > >
    > > childofthe1980s

    >
    >


  8. #8
    Dave Patrick Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    From Server Manager|Configuration|Task Scheduler find the task then check
    the History tab for info on what happens when it is triggered.



    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect


    "childofthe1980s" wrote:
    > Sigh.......the task scheduler is not even running the .cmd file....
    >
    > I don't know what in the world the problem is.
    >
    > childofthe1980s



  9. #9
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    it doesn't say much....it just says that it ran...when it frankly didn't

    "Dave Patrick" wrote:

    > From Server Manager|Configuration|Task Scheduler find the task then check
    > the History tab for info on what happens when it is triggered.
    >
    >
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > Sigh.......the task scheduler is not even running the .cmd file....
    > >
    > > I don't know what in the world the problem is.
    > >
    > > childofthe1980s

    >
    >


  10. #10
    Dave Patrick Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    What happens if you double-click the CMD file? Does it execute correctly?
    Also you must allow the user 'Logon as Batch Job' rights in Local security
    policy.



    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect


    "childofthe1980s" wrote:
    > it doesn't say much....it just says that it ran...when it frankly didn't



  11. #11
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    the command file runs perfectly if I double-click on it.....I'll try to
    review that Local Security policy, though I don't know where that is or work
    with that very much.

    In any case....thanks, for standing by me on this....it's appreciated!

    childofthe1980s

    "Dave Patrick" wrote:

    > What happens if you double-click the CMD file? Does it execute correctly?
    > Also you must allow the user 'Logon as Batch Job' rights in Local security
    > policy.
    >
    >
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > it doesn't say much....it just says that it ran...when it frankly didn't

    >
    >


  12. #12
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Yeah, I just checked...the user does have "Logon as Batch Job" rights.....

    I just don't know. I can't believe something so simple is giving so much
    trouble....I spent more time troubleshooting this than I did creating the
    macros.

    childofthe1980s

    "Dave Patrick" wrote:

    > What happens if you double-click the CMD file? Does it execute correctly?
    > Also you must allow the user 'Logon as Batch Job' rights in Local security
    > policy.
    >
    >
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > it doesn't say much....it just says that it ran...when it frankly didn't

    >
    >


  13. #13
    Dave Patrick Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Also take a look in the event log;

    Server Manager|Diagnostics|Event Viewer|Application
    Logs|Microsoft|Windows|TaskScheduler

    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect


    "childofthe1980s" wrote:
    > Yeah, I just checked...the user does have "Logon as Batch Job" rights.....
    >
    > I just don't know. I can't believe something so simple is giving so much
    > trouble....I spent more time troubleshooting this than I did creating the
    > macros.
    >
    > childofthe1980s



  14. #14
    childofthe1980s Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    No luck...looking through that Event Viewer is like a Chinese puzzle.

    I'm going to bed....hopefully, my comrades at my firm will have some ideas
    tomorrow...otherwise, I guess I will have to initiate a pay as you go support
    case with Microsoft.

    "Dave Patrick" wrote:

    > Also take a look in the event log;
    >
    > Server Manager|Diagnostics|Event Viewer|Application
    > Logs|Microsoft|Windows|TaskScheduler
    >
    > --
    >
    > Regards,
    >
    > Dave Patrick ....Please no email replies - reply in newsgroup.
    > Microsoft Certified Professional
    > Microsoft MVP [Windows]
    > http://www.microsoft.com/protect
    >
    >
    > "childofthe1980s" wrote:
    > > Yeah, I just checked...the user does have "Logon as Batch Job" rights.....
    > >
    > > I just don't know. I can't believe something so simple is giving so much
    > > trouble....I spent more time troubleshooting this than I did creating the
    > > macros.
    > >
    > > childofthe1980s

    >
    >


  15. #15
    Pegasus [MVP] Guest

    Re: Using Windows Server 2008 Task Scheduler to Run a Macro

    Your problem is a something that beginners in Task Scheduler techniques
    often trip over: They think that their task does not run when, in fact, it
    runs all the time but you can't see what's going on. The trick is: give
    yourself some eyes! Continuing from the command that Dave gave you before,
    do this:
    1. Click Start / Run
    2. Type this:
    notepad c:\MyMacro.bat
    3. Press the Enter key.
    4. Allow the batch file to be created.
    5. Copy and paste the following text into the batch file.
    @echo off
    echo %date% %time% %UserName% >> c:\test.txt
    "C:\Program Files\Microsoft Dynamics\GP$DYNGP\Dynamics.exe" "C:\Program
    Files\Microsoft Dynamics\GP$DYNGP\Dynamics.set" D:\GPShare\GP Macros\GP
    Login_CSI.mac" 1>>c:\test.txt 2>>&1
    echo %date% %time% >> c:\test.txt
    {Note that Line 3 is a very long line. It starts with a double quote (")
    and ends with &1.}
    6. Save and close the batch file.
    7. Click Start / Run
    8. Type this:
    c:\MyMacro.bat
    9. Confirm that the file does what it is meant to do.
    10. Examine the log file c:\test.txt. What does it contain?
    11. Invoke c:\MyMacro.bat via the Task Scheduler.
    12. Did it do what you expected?
    13. What does the log file c:\test.txt contain?
    14. What does the Task Scheduler log file contain?

    Note also that macros are by their very nature fragile. They can get
    derailed by many different events, e.g. by an unexpected pop-up, by an
    unexpected response, by something that takes much longer than expected etc.
    etc. They should only be used to facilitate repetitive tasks but never for
    unattended operations. What is your macro supposed to do? Are there
    alternative solutions that do not require macro?

    "childofthe1980s" <childofthe1980s@discussions.microsoft.com> wrote in
    message news:79F909C5-B8D0-40BC-B6DC-B7F25B6F7959@microsoft.com...
    > No luck...looking through that Event Viewer is like a Chinese puzzle.
    >
    > I'm going to bed....hopefully, my comrades at my firm will have some ideas
    > tomorrow...otherwise, I guess I will have to initiate a pay as you go
    > support
    > case with Microsoft.
    >
    > "Dave Patrick" wrote:
    >
    >> Also take a look in the event log;
    >>
    >> Server Manager|Diagnostics|Event Viewer|Application
    >> Logs|Microsoft|Windows|TaskScheduler
    >>
    >> --
    >>
    >> Regards,
    >>
    >> Dave Patrick ....Please no email replies - reply in newsgroup.
    >> Microsoft Certified Professional
    >> Microsoft MVP [Windows]
    >> http://www.microsoft.com/protect
    >>
    >>
    >> "childofthe1980s" wrote:
    >> > Yeah, I just checked...the user does have "Logon as Batch Job"
    >> > rights.....
    >> >
    >> > I just don't know. I can't believe something so simple is giving so
    >> > much
    >> > trouble....I spent more time troubleshooting this than I did creating
    >> > the
    >> > macros.
    >> >
    >> > childofthe1980s

    >>
    >>




Similar Threads

  1. Replies: 5
    Last Post: 29-09-2011, 01:03 PM
  2. Windows Server 2003 64bit (task Scheduler not working)
    By ernieg619 in forum Windows Server Help
    Replies: 1
    Last Post: 19-05-2011, 07:28 AM
  3. How to Use Task Scheduler in Windows XP
    By SmirnOFF in forum Tips & Tweaks
    Replies: 3
    Last Post: 10-04-2009, 11:45 PM
  4. Windows Server 2008 Task Manager Problem
    By Gary Bouchard in forum Windows Server Help
    Replies: 2
    Last Post: 16-09-2008, 07:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,913,257.92040 seconds with 17 queries