Search code examples
batch-filexcopyrobocopy

Batch file not copying 1 file but copies another


I have a batch file and pretty much all it does is copy call sqlcmd, which runs fine, and copy the file to a usb drive.

This is the line I am having problems with:

copy E:\DatabaseBackup\First.bak G:\DatabaseBackup\.
copy E:\DatabaseBackup\Second.bak G:\DatabaseBackup\.

The first line is where it breaks. I get this message:

The parameter is incorrect. 0 file(s) copied.

The second line works fine. I've tried altering the line buy not using a . and even using robocopy, even tried swaping the order they copy, but no luck.

It is due to the size of the bak file? Here are the sizes:

03/02/2016  02:11 PM    55,650,206,208 First.bak
03/02/2016  02:13 PM     2,174,265,856 Second.bak

I verified the directory exists, even though the 2nd copy works fine.

Any suggestions?

IN RESPONSE TO Varon

This is the properties of the usb drive:

enter image description here


Solution

  • The maximum possible size for a file on a FAT32 volume is 4 GB minus 1 byte or 4,294,967,295 (2^32 − 1) bytes.

    Check the target filesystem G: in this case

    Source: https://de.wikipedia.org/wiki/File_Allocation_Table#FAT32