任务计划程序返回0x1错误代码以运行bat文件

时间:2020-04-21 10:13:09

标签: windows batch-file taskscheduler fileshare

我创建了一个批处理文件,将文件从文件共享复制到系统本地驱动程序。当我手动触发批处理文件时,该批处理文件运行良好,但是当我通过任务计划程序触发时,该批处理文件将无法运行。谁能帮我解决这个问题?

我已经使其具有最高的特权运行。但是,它仍然不起作用。

我的批处理文件:

FOR /F %%a IN ("\\serverabc.com\CID\MAC\dump\test*.*") DO (move /Y %%a "E:\UserAcc\Users")

在这里,我将所有以名称“ test”开头的文件移动到运行该批处理文件的当前系统。我无法捕获任何日志。如果有启用日志的方法,请告诉我。

这是我的任务计划程序xml文件:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2019-05-07T05:29:04.2375904</Date>
    <Author>mycomp\myuser</Author>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2019-05-07T09:00:47</StartBoundary>
      <ExecutionTimeLimit>P1D</ExecutionTimeLimit>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>mycomp\myuser</UserId>
      <LogonType>S4U</LogonType>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</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>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>E:\Empty\Nisha\move_file.bat</Command>
    </Exec>
  </Actions>
</Task>

0 个答案:

没有答案
相关问题