比方說,我有這樣的文件夾結構:如何複製文件夾,然後在批處理或PowerShell的重命名文件夾和文件裏面多個文件夾
02548 //let's call this MASTER FOLDER, folder name are using site_id
|- 1. Master File
|- 02548_MSFI.pdf
|- 2. src
|- 02548_main.cpp
|- 3. Backup
|- alpha.svn
我也有site_id.txt文件包含side_id的名字:
02548
03584
05482
07992
05861
我想要做的是將MASTER FOLDER複製到新的文件夾。所以,最後的結果會是這樣的:
|-02548 // MASTER FOLDER
| |- 1. Master File
| |- 02548_MSFI.pdf
| |- 2. src
| |- 02548_main.cpp
| |- 3. Backup
| |- alpha.svn
|-03584 //the folder name are taken from the list inside the site_id.txt
| |- 1. Master File
| |- 03584_MSFI.pdf //please notice the prefix of this file's name
| |- 2. src
| |- 03584_main.cpp //please notice the prefix of this file's name
| |- 3. Backup
| |- alpha.svn
|-05482 //the folder name are taken from the list inside the site_id.txt
| |- 1. Master File
| |- 05482_MSFI.pdf //please notice the prefix of this file's name
| |- 2. src
| |- 05482_main.cpp //please notice the prefix of this file's name
| |- 3. Backup
| |- alpha.svn
and so on until all the site_id from site_id.txt are here.
在現實世界中,site_id.txt將包含1000個以上列表。所以,手動做這件事會非常痛苦。 如何使用批處理腳本或PowerShell來執行此操作?
你到目前爲止嘗試過什麼,你卡在哪裏?關於StackOverflow不是免費的代碼寫作服務! – aschipfl