I have a excutable that runs when I double click on it. However when I put the excutable in schedule task the program fail to run.

I have a excutable that runs when I double click on it. However when I put the excutable in schedule task the program fail to run. This is in Windows Server Standard
This the schedule Task in XML

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2011-12-12T13:15:21.641756</Date>
    <Author>GMGTRANSPORT\rey</Author>
    <Description>Pull Status off UPS Website</Description>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2011-12-12T03:00:00</StartBoundary>
      <ExecutionTimeLimit>PT4H</ExecutionTimeLimit>
      <Enabled>true</Enabled>
      <ScheduleByWeek>
        <DaysOfWeek>
          <Sunday />
          <Monday />
          <Tuesday />
          <Wednesday />
          <Thursday />
          <Friday />
          <Saturday />
        </DaysOfWeek>
        <WeeksInterval>1</WeeksInterval>
      </ScheduleByWeek>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>GMGTRANSPORT\prod</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <IdleSettings>
      <Duration>PT10M</Duration>
      <WaitTimeout>PT1H</WaitTimeout>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>true</WakeToRun>
    <ExecutionTimeLimit>PT4H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>F:\GMGbin\UPSTrace.exe</Command>
    </Exec>
  </Actions>
</Task>

Open in new window

1030071002Asked:
Who is Participating?
 
David Johnson, CD, MVPConnect With a Mentor OwnerCommented:
Weeks? And why mark every day? instead of code block 2?
did you enable history ?? what was the last result?


<CalendarTrigger>
      <StartBoundary>2011-12-12T03:00:00</StartBoundary>
      <ExecutionTimeLimit>PT4H</ExecutionTimeLimit>
      <Enabled>true</Enabled>
      <ScheduleByWeek>
        <DaysOfWeek>
          <Sunday />
          <Monday />
          <Tuesday />
          <Wednesday />
          <Thursday />
          <Friday />
          <Saturday />
        </DaysOfWeek>
        <WeeksInterval>1</WeeksInterval>
      </ScheduleByWeek>
    </CalendarTrigger>

Code Block 1  -- try this for letting it run. 

 <Principals>
    <Principal id="Author">
      <UserId>GMGTRANSPORT\prod</UserId>
     <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals

Code Block 2
 <CalendarTrigger>
      <StartBoundary>2000-01-01T01:40:48</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigge

Open in new window

0
 
1030071002Author Commented:
OK I found out a couple of things when I run the same program in schedule task on windows XP it work find and write the log file out. However when I run it in windows 7 it does not work. I think the windows 7 schedule task does not allow a program to communicate with the desktop. it seems like a cant get focus to a specific button on the program.
0
 
1030071002Author Commented:
History just say I terminated the program LOL
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
David Johnson, CD, MVPConnect With a Mentor OwnerCommented:
Depends upon which user you are dealing with when the program gets started   ... localsystem, sytem, another user  = NO, logged on user = yes
0
 
1030071002Author Commented:
I am using the same user for both OS
0
 
David Johnson, CD, MVPConnect With a Mentor OwnerCommented:
is it the currently logged on user?
0
 
1030071002Author Commented:
Yes, However I am going to want utilize schedule being logoff too
0
 
1030071002Author Commented:
u
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.