Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534

    Grin Any idea for using the Microsoft Task Scheduler

    well I dont know how to use the Microsoft Task Scheduler from ams but there is a web site shows the way to it in other programming language...

    Code:
    http://www.codeproject.com/KB/shell/cscheduledtask.aspx
    but I need help for that...

    Thanks in advance

  2. #2
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Do a search for SCHTASKS on this forum and you will find your answer.

    There is a very long thread on doing just about everything from running to creating a scheduled task.

  3. #3
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    well i already tried it but it doesnt work...

    Code:
    File.Run("SCHTASKS", "\"/Create /SC weekly /D FRI /TN desrat /ST 12:47:00 /TR c:\\xfcgsg.exe\"", "", SW_MINIMIZE, false);

  4. #4
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    You need to tell the task who to run as. In the example below, it will run as "SYSTEM".

    File.Run("SCHTASKS.EXE", "/Create /RU SYSTEM /SC WEEKLY /D FRI /TN desrat /ST 12:47:00 /TR c:\\xfcgsg.exe", "", SW_MINIMIZE, false);

  5. #5
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    thanks mwreyf1 but did u try that because it didnt work for me !!!

  6. #6
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Yes it works for me on XP Pro SP3.

    To confirm it is there, go ALL THE WAY into the "Scheduled Tasks" window (not just view from the Start Menu). You should now see the new task.

    It will not show up in "Scheduled Tasks" when viewed from the Start Menu until you at least log off and back on.

    Also keep in mind that if the app requires ANY user interaction then you can't run it as SYSTEM.


    Hope this helps...
    Last edited by mwreyf1; 12-11-2008 at 08:03 AM.

  7. #7
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    i give up... really it didnt work for me... i also looked at the task folder from windows folder but no....

  8. #8
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Strange...

    It works fine for me.

    Try this:

    Open a dos window (Start > Run and type cmd).

    then

    at the prompt type your command line:

    SCHTASKS /Create /RU SYSTEM /SC WEEKLY /D FRI /TN desrat /ST 12:47:00 /TR c:\xfcgsg.exe

    Now hit <enter>

    Did that work?

    If not, it should return an error explaining why it didn't work.

  9. #9
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    Quote Originally Posted by mwreyf1 View Post
    Strange...

    It works fine for me.

    Try this:

    Open a dos window (Start > Run and type cmd).

    then

    at the prompt type your command line:

    SCHTASKS /Create /RU SYSTEM /SC WEEKLY /D FRI /TN desrat /ST 12:47:00 /TR c:\xfcgsg.exe

    Now hit <enter>

    Did that work?

    If not, it should return an error explaining why it didn't work.
    it didnt work and it said that i have to command that way "SCHTASKS -?" !!!

  10. #10
    Join Date
    Aug 2003
    Posts
    2,427
    Just as a matter of interest I can't find/run SCHTASK.exe on my system.

    I can run Task Scheduler but the Accessories/System Tools shortcut to it just contains a CLSID {D6277990-4C6A-11CF-8D87-00AA0060F5BF} which from my registry appears to call shell32.dll and mtask.dll.

    I don't pretend to understand the way this works but certainly trying to run SCHTASK.exe either from a command line or the start/run option fails with a ......is not a recognised internal or external command or Windows can't find..... message.

    That's on XP Home SP3.

  11. #11
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    I just tried it on a local machine here (mwreyf1 suggestion) and it worked fine - XP pro SP3.

  12. #12
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    i tried with the computer at the office and it didnt work either...

    XP PRO SP3
    and
    XP Home SP2

  13. #13
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    It appears that SCHTASKS.EXE does not come with XP Home.

    You could always include a copy of SCHTASKS.EXE (from XP PRO) in the docs folder of your app and then have the app drop it into the _SystemFolder.

    Then create the task.


    As for the office pc not working...maybe not an admin on the system??? Just a guess...
    Last edited by mwreyf1; 12-12-2008 at 11:47 AM.

Similar Threads

  1. Dependency Module: Microsoft .NET Framework 2.0
    By Adam in forum Setup Factory 8.0 Examples
    Replies: 30
    Last Post: 11-20-2009, 08:27 PM
  2. Dependency Module: Microsoft .NET Framework 1.1
    By Darryl in forum Setup Factory 8.0 Examples
    Replies: 12
    Last Post: 06-10-2008, 02:26 AM
  3. Installing the Microsoft Access Runtime Engine
    By Adam in forum Setup Factory 8.0 FAQ
    Replies: 0
    Last Post: 04-28-2008, 11:22 AM
  4. INFO: Microsoft Data Access Components 2.8 Runtime Notes
    By Desmond in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 11-28-2003, 08:20 AM
  5. INFO: Installing the Microsoft Access Runtime Engine
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-11-2002, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts