开发者

Understanding dir %%a 1>nul 2>nul in batch file

开发者 https://www.devze.com 2023-03-28 16:15 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消