ファイルを複数回コピーして名前を変更する.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 から始めて、name1、name2、name3、nameetc という 4 つのファイル (file.tmpl の複製) を作成します。
この例は実際のコーディング言語ではありません。私がよく知っている言語であるため、一種の php シンタックスを使用しました。