Skip navigation

Is there a 4GB size limit when using VBScript to make file copies?

A. I recently received an email message from a reader who had the belief that a script couldn't copy files over 4GB in size. I decided to test whether this was true.

First, I created a 5GB file by using this command:

D:\temp>fsutil file createnew orig.file 5000000000
Then I wrote the following short script to copy a named file:

On Error Resume Next

'Connect to file system object.
set objFSO=CreateObject("Scripting.FileSystemObject") 

If objFSO.FileExists(objVHD.HardDisk.file) Then
    objFSO.CopyFile WScript.Arguments(0), WScript.Arguments(1)
End If

 
The VBScript script copied the 5GB file just fine. The 4GB limitation could have been because it was copying to a FAT32 partition or because differently formatted drives might use different amounts of disk space while storing the same amount of data.
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish