I have created a batch file to copy files from file share to system local driver. The batch file runs fine when I trigger it manually, but it fails to run when I trigger through the task scheduler. Can anyone help me resolve this issue?
I have made it to run with highest privileges. However, it still does not work.
my batch file:
FOR /F %%a IN ("\\serverabc.com\CID\MAC\dump\test*.*") DO (move /Y %%a "E:\UserAcc\Users")
Here, I am moving all files starting with name 'test' to a the current system where I am running this batch file. I am unable to capture any logs though. If there is a way to enable logs, please let me know.
Here is my task scheduler xml file:
<?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>