How to: Copy Network Shared Files Using Command Prompt


Syed Aslam Basha here from the Information Security Tools team.

Data warehouse projects process the log files which are continuously generated and stored at shared location. To test data warehouse projects you need to have huge sets of these log files. I used a simple way to copy the shared log files continuously and in silent mode so I thought I would share it.

Launch notepad copy paste the below code and save it as Copy.bat. Run command prompt (as administrator) and run the Copy.bat. User should have administrator/read and write permissions on the servers.

 1: copy \\SourceServer\Source\*.* \\TestServer\Destination\ /Z /Y

 

If there aren’t any errors the files will be copied successfully as shown below

C:\Windows\system32>D:\BatchFiles\Copy.bat
Copies files one by one

100 Files copied successfully
C:\Windows\system32>

Modify the above script parameters appropriately to copy the files successfully!

-Syed Aslam Basha (syedab@microsoft.com)

Microsoft Information Security Tools (IST) Team

Test Lead

---------------------------------------------------------

Please leave a comment if the blog post has helped you.

Comments (2)

  1. salvador.elizaldy89@gmail.com says:

    thank you very much, this helped me a lot. do you have official website for me to subscribe?

  2. el'g sylvain says:

    Good, It helps me today
    Thank you

Skip to main content