- Jul
- 442
- 6
Would someone please tell me what is happening here:
I do not understand an errorlevel=2 when using the /s option. This is also true when using pdir.
Code:
C:\JPSoft>*dir /s /b test1* || (echo. & echo there were %_dir_files files displayed and %_dir_errors dir errors)
C:\JPSoft\test1.bak
C:\JPSoft\test1.btm
C:\JPSoft\test1.zip
C:\JPSoft\TCMD15x64\logs\test1.txt
there were 4 files displayed and 0 dir errors
C:\JPSoft>*dir /b test1* || (echo. & echo there were %_dir_files files displayed and %_dir_errors dir errors)
test1.bak
test1.btm
test1.zip
I do not understand an errorlevel=2 when using the /s option. This is also true when using pdir.
Code:
C:\JPSoft>*dir /b /s test1* & (echo. & echo errorlevel === %errorlevel)
C:\JPSoft\test1.bak
C:\JPSoft\test1.btm
C:\JPSoft\test1.zip
C:\JPSoft\TCMD15x64\logs\test1.txt
errorlevel === 2
C:\JPSoft>*dir /b test1* & (echo. & echo errorlevel === %errorlevel)
test1.bak
test1.btm
test1.zip
errorlevel === 0
C:\JPSoft>*pdir /b test1* & (echo. & echo errorlevel === %errorlevel)
test1.bak
test1.btm
test1.zip
errorlevel === 0
C:\JPSoft>*pdir /b /s test1* & (echo. & echo errorlevel === %errorlevel)
C:\JPSoft\test1.bak
C:\JPSoft\test1.btm
C:\JPSoft\test1.zip
C:\JPSoft\TCMD15x64\logs\test1.txt
errorlevel === 2