DosTips.com

A Forum all about DOS Batch
It is currently 24 Apr 2017 22:46

All times are UTC-06:00




Post new topic  Reply to topic  [ 29 posts ]  Go to page Previous 1 2
Author Message
PostPosted: 06 Jan 2017 03:58 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
Compo wrote:
If you are only performing a copy, and one which will happen relatively quickly, why would the order matter? If I was copying the content of a script on here, the end product would look exactly the same if copied it from bottom to top or the opposite.


Some devices like the ASUS OPlay list files in disk order rather than alphabetical order. That makes it hard to find what you are looking for. Using this method, the disk order and the alpha order will match. Unfortunately, you have to copy all files from scratch when you add files...


Top
   
PostPosted: 06 Jan 2017 04:01 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
Sounak@9434 wrote:
I am just replying based on the command you said earlier 'dir c:\a\b\c /a-d /on /b'


Thank you! Just a little edit if you run this from another directory...

Code: Select all
for /f "delims=" %%a in ('dir c:\a\b\c /a-d /on /b') do (
   copy "c:\a\b\c\%%a" "c:\d\e\f"
)


Top
   
PostPosted: 06 Jan 2017 04:12 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
One says the pipe character must be used if file names contain spaces:

for /f "delims=|".....

True?


Top
   
PostPosted: 06 Jan 2017 04:34 
Offline

Joined: 21 Mar 2014 08:50
Posts: 388
False, (leave it as it was).

…and as I've said, it doesn't matter which order you copy those files, it will not effect the default directory sort order.


Top
   
PostPosted: 06 Jan 2017 04:38 
Offline

Joined: 16 Dec 2016 22:31
Posts: 97
drgt wrote:
One says the pipe character must be used if file names contain spaces:

for /f "delims=|".....

True?

As filename can't contain "|"(pipe) character by default it does not matter if you use | as a delim or just leave "delims="

Sounak


Top
   
PostPosted: 06 Jan 2017 09:32 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
Compo wrote:
…and as I've said, it doesn't matter which order you copy those files, it will not effect the default directory sort order.


Thanks!

Here is an example of disk order listing:
Image


Top
   
PostPosted: 06 Jan 2017 09:56 
Offline

Joined: 21 Mar 2014 08:50
Posts: 388
@drgt, I fail to see the relevance.

You've shown a couple of images showing directory structures.
That has no bearing whatsoever on the order that files are copied into your specifically named folder.


If you were intercepting the files during their copy, for an intermediate action, I may understand the need to copy them in an order but not for a direct A to B copy process.


Top
   
PostPosted: 06 Jan 2017 10:33 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
I will try again.
Image

Image


Top
   
PostPosted: 06 Jan 2017 11:14 
Offline

Joined: 21 Mar 2014 08:50
Posts: 388
That is just an output of the DIR command, it has no bearing whatsoever on the directory order of files when copied. There should be no relationship between the viewed directory order and the order at which files were copied to the device..


Top
   
PostPosted: 06 Jan 2017 11:19 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
Then why the device displays them in alpha order when copied in alpha order and not so when they are copied in the conventional way?


Top
   
PostPosted: 06 Jan 2017 12:08 
Offline
Expert

Joined: 06 Dec 2011 22:15
Posts: 1345
Location: México City, México
Compo,

Perhaps you not remember, but in the old MS-DOS command.com days the DIR command did not sorted the files in any order, so they always appear in the same order the files were copied to the disk. If you have any device that does not sort the files by name (like many cheap MP3 players, for example), then the files will be processed in the order they were copied to the disk, so in these cases such an order is important.

Antonio


Top
   
PostPosted: 06 Jan 2017 12:25 
Offline
Expert

Joined: 23 Dec 2011 13:59
Posts: 3503
We have Networked attached storage that does this as well. Irritates the hell out of me on that server.


Top
   
PostPosted: 06 Jan 2017 12:57 
Offline

Joined: 04 Mar 2014 11:14
Posts: 82
Location: germany
The file system at MFT or FAT is like a table of contents (TOC) in books or an archive file.
If the file stored on the hard disk is recorded on these repositories.
Your files are listed in this list.
When you duplicate your files, this list is read and treated one by one like the table of contents.

Phil


Top
   
PostPosted: 06 Jan 2017 13:19 
Offline

Joined: 21 Sep 2010 02:22
Posts: 96
Thank you all for your contributions!
Happy New Year!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 29 posts ]  Go to page Previous 1 2

All times are UTC-06:00


Who is online

Users browsing this forum: Google [Bot], MSNbot Media and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited