Reputation: 1
I have a pair of scheduled tasks that execute a powershell scripts running on a server. Both have been running for months without any issues and the scripts have not been changed.
Today for whatever reason the tasks showed as completing successfully but returned the code "0xFFFF0000 (4294901760). Its only happened one time (so far).
Manually running the scheduled tasks doesn't trigger the issue again but I'm worried it might later. Can't find anything related to task scheduler and that error code.
Edit: Added the scripts. Also important to note: Both scripts generate/write to log files, but no logging was done when the error occurred. Script 2 would run for an hour if it didn't find any files, but the scheduled task stopped within a second.
Script 1:
Robocopy D:\Folder "\\contoso.com\files\department\folder\a subfolder" /LOG:C:\folder\robocopy.log /XX /R:10 /W:10 /E
Script 2:
net use i: "\\192.168.1.1\a folder\subfolder"
$d = "\\192.168.1.1\a folder\subfolder"
$e = "C:\folder\subfolder"
$log = "C:\folder\logfile.txt"
$start = get-date -format 'MM/dd/yyyy HH:mm'
"$start Script process started" | Out-File -FilePath $log -Append
for ($a=0; $a -lt 60; $a++){
$files=get-childitem $d
if(($files).count){
set-location $d
$time= get-date -format 'MM/dd/yyyy HH:mm'
"$time Files found" | Out-File -FilePath $log -Append
foreach($file in $files){
Move-Item $file $e
"$time Moved " + $d + "\$file to $e" | Out-File -FilePath $log -Append
}
}
start-sleep 60
}
net use i: /del /y
$end = get-date -format 'MM/dd/yyyy HH:mm'
"$end Script process ended" | Out-File -FilePath $log -Append
"----------------------------------" | Out-File -FilePath $log -Append
exit
Upvotes: 0
Views: 147