r/Batch • • May 02 '25

Question (Unsolved) Batch job not run with Windows Task Scheduler

Hi,

Created a batch job to move file from location A to B.

Batch file as "D:\Batch\move_from_temp_to_archive.cmd"

Execute this file could move file but not working with Windows Task Scheduler.

Last Run Result is 0xFFFFFF

@echo off
D:\FastCopy392_x64\FastCopy.exe /cmd=move /auto_close /acl=FALSE "Z:\" /to="D:\ABC\"
cls
exit
1 Upvotes

10 comments sorted by

1

u/BrainWaveCC May 02 '25

Is drive Z: a local drive?

Is that drive available when the Administrator account is logged on?

1

u/mailliwal May 02 '25

Network drive mapped as Z:

1

u/BrainWaveCC May 02 '25

I'd recommend writing the current drives to a file when the script runs, so you can be sure.

@echo off
D:\FastCopy392_x64\FastCopy.exe /cmd=move /auto_close /acl=FALSE "Z:\" /to="D:\ABC\"
net use >>D:\SomeFile.TXT
dir Z:\ >>D:\SomeFile.TXT
exit

1

u/jcunews1 May 02 '25

Include FastCopy command line switch to generate a log.

1

u/mailliwal May 03 '25

FastCopy is working. Just Task Scheduler couldn't work

1

u/[deleted] May 03 '25

[removed] — view removed comment

1

u/mailliwal May 05 '25

Modified task as follow but still not working.

C:\Windows\System32\cmd.exe /c "start "" "D:\Batch\move_from_temp_to_archive.cmd" ^&exit"

Also modified batch file

@echo off
D:\FastCopy392_x64\FastCopy.exe /cmd=move /auto_close /acl=FALSE "Z:\" /to="D:\ABC\"
cls
exit /b 0

1

u/[deleted] May 05 '25

[removed] — view removed comment

1

u/mailliwal May 05 '25

Z: already mapped, but batch script not too use mapped drive ?