Understanding dir %%a 1>nul 2>nul in batch file
Got this batch file which does exactly what I want, however I don't fully understand what its coding is doing can somebody run me through it?
开发者_JS百科@echo off
for /F %%a in ('mountvol ^| find ":\"') do (
dir %%a 1>nul 2>nul
if not ErrorLevel 1 (
del /s /f %%ahuntthisfile.txt
del /s /f %%aandthisfiletoo.txt
)
)
particularly the dir %%a 1>nul 2>nul
has got me stuck.
I think that dir %%a 1>nul 2>nul
lists the content of the folder, and it redirects the command output to the null device.
精彩评论