How to copy file via network

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
finaliscom
Posts: 1
Joined: 29 Nov 2010 22:28

How to copy file via network

#1 Post by finaliscom » 29 Nov 2010 22:34

I have the cafe game net, there are 20 pc's. I want to put command every pc client for the copy file and folder was sharing on one pc.
example...
on com_1 i have folder shared with name "game" on drive D, so i want to put the other pc (com_2,3,etc) command batch file on the start up menu for the copy thats file and folder automatic with batch command echo off. The other pc client have the same name of folder (game) on drive D. And the last command, i want to write net send to one pc (com_1) for tell this job ending.

Please help my problem... for master batch script on notepad. Thank you

maniacal
Posts: 15
Joined: 29 Nov 2010 23:02

Re: How to copy file via network

#2 Post by maniacal » 30 Nov 2010 00:13

So what you want is to have every computer on your network copy a shared folder called 'game' from com_1 at startup?
If so, the location of this folder will be \\com_1\game
the command you are looking for should be:

copy "\\com_1\game" "D:\game" /y

This will copy the contents of the shared game folder to D:\game on the computer the batch file is run from. The '/y' switch just means that all the files in "D:\game" will be overwritten by those in "\\com_1\game", this can slow down the copy process as all files will need to be copied every time.

However, if the game folder is very large, I would suggest using another command called robocopy. This command comes standard with Windows 7 and Vista aswel but may have to be downloaded to be used on earlier OS's.

With Robocopy, the code would look more like this:

robocopy "\\com_1\game" "D:\game" /MIR

'robocopy' will do the same as 'copy' but with the /MIR switch, the directories will be mirrored, meaning that only new files will be copied, speeding up the copy process because there wont be the need to overwrite files.

I'm not too sure about the use of netsend though.

Post Reply