- May
- 239
- 2
Does the DIR command allow options to be placed after the file/directory name specifications? It does seem to cause some problems when you put options last at least.
In the example below the /b switch is only applied to dir2.
C:\temp\test>dir dir1 dir2 /B
Volume in drive C is Local Disk Serial number is 60cd:fa66
Directory of C:\temp\test\dir1\*
20.08.2008 9:42 <DIR> .
20.08.2008 9:42 <DIR> ..
20.08.2008 9:42 13 test1
20.08.2008 9:42 13 test2
20.08.2008 9:42 13 test3
39 bytes in 3 files and 2 dirs 12 288 bytes allocated
8 406 994 944 bytes free
name1
name2
name3
But when you put it first it is applied to both dir1 and dir2.
C:\temp\test>dir /B dir1 dir2
test1
test2
test3
name1
name2
name3
When you read the help entry for DIR it seems to suggest you should put all options before all file names. Sometimes, in batch files and aliases, it would be easier if you could put the options last though.
In the example below the /b switch is only applied to dir2.
C:\temp\test>dir dir1 dir2 /B
Volume in drive C is Local Disk Serial number is 60cd:fa66
Directory of C:\temp\test\dir1\*
20.08.2008 9:42 <DIR> .
20.08.2008 9:42 <DIR> ..
20.08.2008 9:42 13 test1
20.08.2008 9:42 13 test2
20.08.2008 9:42 13 test3
39 bytes in 3 files and 2 dirs 12 288 bytes allocated
8 406 994 944 bytes free
name1
name2
name3
But when you put it first it is applied to both dir1 and dir2.
C:\temp\test>dir /B dir1 dir2
test1
test2
test3
name1
name2
name3
When you read the help entry for DIR it seems to suggest you should put all options before all file names. Sometimes, in batch files and aliases, it would be easier if you could put the options last though.