当我手动运行计划任务时,它将运行,但自动运行时会收到0x800710E0错误

时间:2019-04-28 15:26:36

标签: powershell scheduled-tasks

我已经使用ps1文件创建了计划任务,该文件在onedrive上创建了文件备份。当我通过计划任务屏幕手动运行该脚本时,该脚本起作用了,但是当我尝试通过设置的触发器运行该脚本时,出现了0x800710E0错误

我尝试了“常规”,“选项”和“条件”中的每个选项。

这是我现在在xml中设置的计划任务设置:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2019-04-28T13:29:34.8238925</Date>
    <Author>LAPTOP-5E0BAOCL\Alex</Author>
    <URI>\Backup Gym Application</URI>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2019-04-28T16:02:54</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-2484025877-494337154-2092944163-1001</UserId>
      <LogonType>S4U</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
    <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe</Command>
      <Arguments>C:\Users\Alex\OneDrive\Documents\BackUpGymApplication.ps1</Arguments>
    </Exec>
  </Actions>
</Task>

我希望脚本在一个驱动器中创建文件备份,但是我收到0x800710E0错误。

0 个答案:

没有答案