By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!When using option /Nm:1, DIR returns the correct output but the internal variable _dir_files is zero.
The same variable has the correct value if this option is not used.
v:\> *dir /nm:5 i*
Volume in drive V is DATA Serial number is c007:d3e4
Directory of V:\i*
2014-06-16 21:19 <DIR> InternetRegistries
2012-06-05 01:46 <DIR> ip2c
2014-06-03 12:38 <DIR> ipalloc
2014-05-27 17:01 178 iconshow.btm
2014-06-03 12:34 25,091 ipalloc.txt
6,475,681,792 bytes free
v:\> echo %_dir_dirs
0
v:\> echo %_dir_files
0
Code:v:\> *dir /nm:5 i*
p:\> *dir /nm:10 v:\i* & echo %_dir_dirs & echo %_dir_files
Volume in drive V is DATA Serial number is c007:d3e4
Directory of V:\i*
2014-06-16 21:19 <DIR> InternetRegistries
2012-06-05 01:46 <DIR> ip2c
2014-06-03 12:38 <DIR> ipalloc
2014-05-27 17:01 178 iconshow.btm
2014-06-03 12:34 25,091 ipalloc.txt
2013-10-20 01:26 244 ipconfigall.btm
2013-11-02 17:10 617 ipcountry.btm
2013-11-03 14:48 831 ipcountry2.btm
2014-06-03 12:36 17,567 ipreg.txt
44,528 bytes in 6 files and 3 dirs 65,536 bytes allocated
6,475,677,696 bytes free
3
6
p:\> *dir /nm:5 v:\i* & echo %_dir_dirs & echo %_dir_files
Volume in drive V is DATA Serial number is c007:d3e4
Directory of V:\i*
2014-06-16 21:19 <DIR> InternetRegistries
2012-06-05 01:46 <DIR> ip2c
2014-06-03 12:38 <DIR> ipalloc
2014-05-27 17:01 178 iconshow.btm
2014-06-03 12:34 25,091 ipalloc.txt
6,475,677,696 bytes free
0
0
s:\> *dir /nm:129 c:\windows\system32\i* | grep allocated & echo %_dir_dirs & echo %_dir_files
0
0
s:\> *dir /nm:130 c:\windows\system32\i* | grep allocated & echo %_dir_dirs & echo %_dir_files
57,448,217 bytes in 125 files and 5 dirs 57,655,296 bytes allocated
5
125
s:\> *dir /nm:131 c:\windows\system32\i* | grep allocated & echo %_dir_dirs & echo %_dir_files
57,448,217 bytes in 125 files and 5 dirs 57,655,296 bytes allocated
5
125