1、遍历某个文件夹及其子文件夹目录,删除全部名为CVS的目录:
进入CMD界面执行以下两句,第一句进入特定待查找的目录,第二句删除当前目录及子目录下全部名为CVS的文件夹
cd "E:\3_DSP"
for /R %s in (.,*) do rd /q /s %s\CVS
DOS命令:用For命令遍历文件夹 (2011-04-02 21:29:38)
标签: 技术探究
Syntax:
FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]
Description:
Walks the directory tree rooted at [drive:]path, executing the FOR statement in each directory of the tree. If no directory specification is specified after /R then the current directory is assumed.
If set is just a single period (.) character then it will just enumerate the directory tree.
If set is just a single asterisk (*) character then it will just enumerate the files.
If set is a single period (.) character followed by a single asterisk (*) character then it will enumerate the sub-folders firstly and then files under t