locked
Win XP vs. Win 7 Scheduling Tasks RRS feed

  • Question

  • Hello,

    We developed an MFC application that schedules tasks.
    When we run the applicaton on Win XP,
    the application schedules the tasks,
    and displays the message OK. First,
    the application checks, if the task
    has already been schedule, using the Task
    Name, and then notifies the user.


    When we run the application on Win 7.
    Our application does not find the task.
    If, we manually schedule the task, using
    SCHTASKS.EXe, our application still does
    not find the task. But, if we select the
    the run option, from the Schedule Task menu.
    Our application runs - sort of.
    We know the application is running, because
    there is an audio component to the task,
    and we can hear the sound. However, we do not
    see the message box, that is associated with
    the sound.

    All of the functionality works OK, on Win XP.
    But, we have limited capability on Win 7.

    When running on Win 7, is it possible to set the
    application to Win XP compatitbility?

    How come our application can find the task
    OK, on Win XP, but cannot find the task on Win 7.
    Is there a different Task API for Win 7?

    TIA,
    -jc

    Friday, June 11, 2010 5:02 PM

Answers

  • Sorry, I obviously didn't understand the problem clearly when I read your initial post.

    It really does sound like a security-related issue. Are you convinced the application is running as Administrator? What happens if you turn off UAC?

    • Marked as answer by jrcii Friday, June 11, 2010 9:54 PM
    Friday, June 11, 2010 6:42 PM

All replies

  • See if running the application as Administrator solves the problem. (Right-click over the MFC application name, and "Run as Administrator").

    Friday, June 11, 2010 5:29 PM
  • Hello Brian,

    Thank you for replying to my posting.

    Yes, we tried  setting the application to

    "Run as Administrator", and that did not

    solve the problem.

    Any other ideas?

    Friday, June 11, 2010 6:01 PM
  • Yes, see if this makes sense. I believe it's because scheduled tasks now run in Session 0, and no longer are allowed to interact with the desktop belonging to the logged in user. Even before Windows 7 and Vista this was greatly discouraged for several reasons (for example, suppose there is no one logged in), including the "shatter attack" security exploit. If a scheduled task displays a messagebox, it is displayed in the Session 0 desktop, which is noninteractive and separate from the logged in user. Hence it is never seen.

    If the scheduled task really does have to throw up a message box, it should use the WTSSendMessage() function. 

     

    Friday, June 11, 2010 6:29 PM
  •  

    No, the application does not have to display a message box.

    However, the application does have to be able to detect,

    if the task has already been scheduled.

    How come, on Win 7, our application cannot detect, if the

    task has already been scheduled?

    Friday, June 11, 2010 6:40 PM
  • Sorry, I obviously didn't understand the problem clearly when I read your initial post.

    It really does sound like a security-related issue. Are you convinced the application is running as Administrator? What happens if you turn off UAC?

    • Marked as answer by jrcii Friday, June 11, 2010 9:54 PM
    Friday, June 11, 2010 6:42 PM
  • The OP did mention the message box wasn't seen, but I guess it was a minor issue in determining if the scheduled program had indeed run, and not the main problem.  I would also encourage making sure there is a manifest in the app so that it won't use the registry virtual store, and also allow setting the requestedExecutionLevel to requireAdministrator, thus really insuring it is run as Administrator.
     
    -- David

    Sorry, I obviously didn't understand the problem clearly when I read your initial post.

    It really does sound like a security-related issue. Are you convinced the application is running as Administrator? What happens if you turn off UAC?

    Thursday, June 17, 2010 9:36 AM