I have VPS with Windows Server 2008. I have configured Task Scheduler to run the *.exe (please, see below XML file I retrieved from c:\Windows\System32\Tasks\Chronos\
). The Run on startup
trigger is enabled (I suppose it is BootTrigger
).
The task runs and works until the Windows reboots due to updates or other reasons. The task is not started after reboot. I must login to Windows and manually start Task Scheduler, select the task and press Run
button). Why it does not launch the task on Windows startup?
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2014-09-06T16:47:00.9812</Date>
<Author>VMI28078\Administrator</Author>
</RegistrationInfo>
<Triggers>
<BootTrigger>
<Enabled>true</Enabled>
</BootTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<RunLevel>LeastPrivilege</RunLevel>
<UserId>VMI28078\chronos</UserId>
<LogonType>S4U</LogonType>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
<RestartOnFailure>
<Interval>PT1M</Interval>
<Count>999</Count>
</RestartOnFailure>
</Settings>
<Actions Context="Author">
<Exec>
<Command>D:\chronos\gate\ChronosGate.exe</Command>
<Arguments>rVPSgate.config</Arguments>
<WorkingDirectory>D:\chronos\gate</WorkingDirectory>
</Exec>
</Actions>
</Task>
答案 0 :(得分:-1)
Web有很多关于使用INSTSRV或SC的建议,但是:
最简单的方法是使用具有GUI的http://nssm.cc,对我来说就像一个魅力。