Basic windows batch file to copy directory (FOR and XCOPY) based on text file

已完成 已发布的 May 3, 2014 货到付款
已完成 货到付款

I need a batch file that reads a list of directories from a batch file and copies each directory entirely, including all subdirectories, to a destination path that is based on a combination of user input (command line parameter) and the source path.

Text file ([url removed, login to view]):

\\server\share8\Col_3cf01b70-c413-4fba-bfd8-f4728c3db792\5 Aug 10 08 57 48 AM\Item_a54c4d15-324f-4ccb-a945-b7418193aed3\1

\\server\share17\Col_77b140e6-9909-4534-b2a5-4f34f60c2d7c\28 Feb 11 12 57 50 PM\Item_6d604a41-2fce-49a3-b2d8-1288d49011aa\1

\\server\share6\Col_0b9b6932-e71d-406f-a96c-edd3f1131f84\16 Oct 09 10 49 29 AM\Item_6742637b-2fb2-4be4-97c1-387b903a265a\1

\\server\share14\Col_2d0cf69e-121b-41ee-9fb7-d7ea0db510cf\23 Sep 10 11 39 58 AM\Item_13cd7388-74ab-46d8-902e-04ea6a3276e5\1

\\server\share6\Col_fd55faa0-f309-4793-8d53-51c36fee86a1\15 Oct 09 04 04 28 PM\Item_ebcc049e-77b4-454f-a3a5-b2e7b93df32d\1

\\server\share6\Col_74245aaf-25a9-4a1c-b907-fc9c81ff522b\6 Jul 10 04 44 17 PM\Item_b73790bc-fd55-478a-b29f-a624b40dc372\1

\\server\share6\Col_64e2a744-f6af-494d-9767-8155136534d4\15 Feb 10 06 42 15 PM\Item_83677379-cfd3-4037-9d0c-e394765c252a\1

Command line:

C:/> copydirs "d:\"

Result: all files and folders from the list above are copied to the d: drive and the source path is left intact (e.g., a directory is created in the desitnation path and all files and folders are copied recursively)

The contents of

\\server\share8\Col_3cf01b70-c413-4fba-bfd8-f4728c3db792\5 Aug 10 08 57 48 AM\Item_a54c4d15-324f-4ccb-a945-b7418193aed3\1

are copied to

d:\server\share8\Col_3cf01b70-c413-4fba-bfd8-f4728c3db792\5 Aug 10 08 57 48 AM\Item_a54c4d15-324f-4ccb-a945-b7418193aed3\1

Something like this, but that works as described above

for /f "delims=" %%i in ([url removed, login to view]) do xcopy "%%i" . /s

Please advise with questions.

DOS shell脚本

项目ID: #5892734

关于项目

4个方案 远程项目 活跃的May 3, 2014

授予:

grimeton

Hi, do put your stuff into a file called e.g. "[login to view URL]", then run this command: for /f/ "tokens=* delims= " %a in ([login to view URL]) do ( echo "%a" ) and be happy. You can modify the command in the () todo whateve 更多

$25 USD 在1天内
(0条评论)
0.0

有4名威客正在参与此工作的竞标,均价$33/小时

AEGLESol

Hi there, I am expert in power shell script and batch files. I have studied you requirements and I can deliver it in few hrs. Please reply to discuss it further and sort a solution for it. Please have a look of my p 更多

$50USD 在1天里
(0条评论)
0.0
cybersec

Dear Sir, I'm cyber security researcher. I use PowerShell script in windows systems for many years. I can do this job with PowerShell script. I would like to talk in detail about the job requirements. Best Regards.

$30USD 在1天里
(0条评论)
0.0
dimkazakos

A proposal has not yet been provided

$25 USD 在0天内
(0条评论)
0.0