我需要帮助创建一个批处理文件,该文件首先在每个子目录中的每个文件上运行一个命令,然后删除该命令刚刚运行的文件。在子目录中的每个文件上执行,然后删除文件
例如:
c:\temp\1\file.abc
c:\temp\2\file.abc
c:\temp\2\file2.abc
Would run:
execute_command.exe c:\temp\1\file.abc
del c:\temp\1\file.abc
execute_command.exe c:\temp\2\file.abc
del c:\temp\2\file.abc
execute_command.exe c:\temp\2\file2.abc
del c:\temp\2\file2.abc
任何帮助,将不胜感激。谢谢。
嗯,我想出了如何使用“for/f%f in('dir/bc:\ temp \ 1')执行execute_command.exe c:\ temp \ 1 \”指定的目录对于单个目录,但我不知道如何为每个子目录做类似的事情;我可以使用dir/a/s/b获得所有文件的列表,但是在那里,我一直在坚持如何使用它们来执行命令。 – Rob 2011-03-29 19:35:18