File block copy order

  • Thread starter Thread starter Michael Shergold
  • Start date Start date
M

Michael Shergold

Selecting a block of files to be copied from hard drive to a media drive
(USB), doing COPY and then PASTE results in the files arriving at the media
device in a rather strange sequence.. for example files 01.jpg to 18.jpg
get copied across in sequence
13,14,15,16,17,1,18,02,03,04,05,06,07,08,09,10,11,12. This is not
absolutely consistent.
The media player plays in the sequence received giving nomenclature 1/18,
2/18 etc. these being files named 13 and 14. Is there anyway to preserve
the 'block' file copy sequence or must I always copy files one at a time
to preserve the sequence?

Michael in sunny Sussex, England
 
Use a script to sort an array of the filenames, then use the array to copy.
This script can modified to use the correct folder names.
--sortedCopy.vbs--
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='C:\SourceFolder'} Where " _
& "ORDER BY ASC")
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each objFile In colFileList
objFSO.CopyFile objFile , "D:\Archive\", OverwriteExisting
Next
--end file--
 
Back
Top