我想让一个.bat复制&多次重命名一个文件。我想要列出名称和原始文件,然后我想复制该文件并将其重命名为列表中的每个名称。使用.bat文件语言复制和重命名文件?
我如何使用.bat文件做到这一点?
也有可能从复制/重命名的.bat到.rar或.zip每个文件运行winrar?
实施例:
$file = "file.tmpl";
$names = "name1, name2, name3, nameetc";
foreach($names as $name) {
copy $file; //to avoid deleting the original
rename $file to $name;
zip $name; //I dont really need this but if its easy to do i will like to use it
}
所以我开始与file.tmpl和我结束了4个称为NAME1,NAME2 NAME3,nameetc文件(其是file.tmpl的副本)。
这个例子不是一个真正的编码语言,我使用了一种php sintax,因为我知道的语言更多。
如果你有xargs,那会让你更容易。 – 2010-06-05 16:47:35
我真的不明白你想要做什么。你能举个例子吗? – 2010-06-05 16:55:53
我添加了一个例子。 我会使用xargs,但我赢了,是否可用于Windows? – flyout 2010-06-05 17:12:47