need help batch script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

need help batch script

#1 Post by lioncava » 21 Dec 2013 22:01

dear all
any help to make batch script this the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer...
instead of turning on all 60 computers and updating all online games, he'll just have to update one computer and just copy the update or overwrite the old files in all 60 computers...

i have 1 server game i want only copy newer files to pc all pc client
example
pc server = 192.168.3.200
(D\gameonline\dota2\)
pc -01 = 192.1683.1
(D\gameonline\dota2\)


how to batch script

thx before

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#2 Post by foxidrive » 21 Dec 2013 22:25

lioncava wrote:the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer...
instead of turning on all 60 computers and updating all online games, he'll just have to update one computer and just copy the update or overwrite the old files in all 60 computers...

i have 1 server game i want only copy newer files to pc all pc client
example
pc server = 192.168.3.200
(D\gameonline\dota2\)
pc -01 = 192.1683.1
(D\gameonline\dota2\)


Test this - it should do a mirror backup from the source to the target - copying only new files and making an exact copy on the target folder.

EDITED:

Code: Select all

@echo off
set "pc_server=\\192.168.3.200\D\gameonline\dota2"
set "pc-01=\\192.1683.1\D\gameonline\dota2"
robocopy "%pc_server%" "%pc-01%" /mir

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#3 Post by lioncava » 22 Dec 2013 00:00

thx for replay
already test bat file but nothing happen
when i clik bat file just blink and nothing happen

this actual my bat file

Code: Select all

@echo off
set "pc_server=192.168.3.77\D:\GameOnline\DOTA 2\"
set "pc-24=192.168.3.24\D\DOTA 2\"
robocopy "%pc_server%" "%pc-24%" /mir


thx

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#4 Post by foxidrive » 22 Dec 2013 00:46

lioncava wrote:thx for replay
already test bat file but nothing happen
when i clik bat file just blink and nothing happen

this actual my bat file

Code: Select all

@echo off
set "pc_server=192.168.3.77\D:\GameOnline\DOTA 2\"
set "pc-24=192.168.3.24\D\DOTA 2\"
robocopy "%pc_server%" "%pc-24%" /mir


thx


Open a cmd window and type the batch file name to launch it. You will then see any error messages on the console.

In your pc_server variable you have D: and the : is an illegal character in a path.

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#5 Post by lioncava » 22 Dec 2013 00:54

what should I do to fix it

thx

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#6 Post by lioncava » 22 Dec 2013 01:00

already to change that ilegal code hehe

but same nothing happen

Code: Select all

@echo off
set "pc_server=192.168.3.77\D\GameOnline\DOTA 2\"
set "pc-24=192.168.3.24\D\DOTA 2\"
robocopy "%pc_server%" "%pc-24%" /mir

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#7 Post by foxidrive » 22 Dec 2013 01:01

Open a cmd window and type the batch file name to launch it. You will then see any error messages on the console.

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#8 Post by lioncava » 22 Dec 2013 01:15

this error

Code: Select all

D:\GameOnline>tes.bat

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows

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

  Started : Sun Dec 22 14:14:51 2013

   Source : D:\GameOnline\192.168.3.77\D\GameOnline\DOTA 2" 192.168.3.24\D\DOTA\

     Dest : D:\GameOnline\2"\

    Files : *.*

  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30

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

2013/12/22 14:14:51 ERROR 3 (0x00000003) Accessing Source Directory D:\GameOnlin
e\192.168.3.77\D\GameOnline\DOTA 2" 192.168.3.24\D\DOTA\
The system cannot find the path specified.
D:\GameOnline>

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#9 Post by foxidrive » 22 Dec 2013 01:50

try this:

Code: Select all

@echo off
set "pc_server=\\192.168.3.77\D\GameOnline\DOTA 2\"
set "pc-24=\\192.168.3.24\D\DOTA 2\"
robocopy "%pc_server%" "%pc-24%" /mir

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#10 Post by lioncava » 22 Dec 2013 02:01

this error

Code: Select all

D:\GameOnline>tes.bat

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows

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

  Started : Sun Dec 22 14:58:46 2013

2013/12/22 14:58:46 ERROR 67 (0x00000043) Getting File System Type of Source \\1
92.168.3.77\D\GameOnline\DOTA 2" \192.168.3.24\D\DOTA\
The network name cannot be found.

   Source - \\192.168.3.77\D\GameOnline\DOTA 2" \192.168.3.24\D\DOTA\
     Dest : D:\GameOnline\2"\

    Files : *.*

  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30

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

2013/12/22 14:58:46 ERROR 67 (0x00000043) Accessing Source Directory \\192.168.3
.77\D\GameOnline\DOTA 2" \192.168.3.24\D\DOTA\
The network name cannot be found.
D:\GameOnline>

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#11 Post by foxidrive » 22 Dec 2013 02:18

It looks like the trailing slashes are significant. Try this version.

Code: Select all

@echo off
set "pc_server=\\192.168.3.77\D\GameOnline\DOTA 2"
set "pc-24=\\192.168.3.24\D\DOTA 2"
robocopy "%pc_server%" "%pc-24%" /mir

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#12 Post by lioncava » 22 Dec 2013 03:29

this bro

Code: Select all

D:\GameOnline>tes.bat

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows

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

  Started : Sun Dec 22 16:28:31 2013

2013/12/22 16:28:31 ERROR 67 (0x00000043) Getting File System Type of Source \\1
92.168.3.77\D\GameOnline\DOTA 2\
The network name cannot be found.

   Source - \\192.168.3.77\D\GameOnline\DOTA 2\
     Dest : \\192.168.3.24\D\DOTA 2\

    Files : *.*

  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30

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

2013/12/22 16:28:31 ERROR 67 (0x00000043) Accessing Source Directory \\192.168.3
.77\D\GameOnline\DOTA 2\
The network name cannot be found.
D:\GameOnline>

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#13 Post by foxidrive » 22 Dec 2013 03:32

The error The network name cannot be found. means that this path you are using doesn't exist.

\\192.168.3.77\D\GameOnline\DOTA 2\

lioncava
Posts: 12
Joined: 21 Dec 2013 21:33

Re: need help batch script

#14 Post by lioncava » 22 Dec 2013 03:44

this bro in my server
Image

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: need help batch script

#15 Post by foxidrive » 22 Dec 2013 04:00

It's not accessible from the LAN.

open a cmd prompt and type this to see if it returns a directory list.

dir "\\192.168.3.77\D\GameOnline\DOTA 2"


You probably haven't shared drive D: or this folder.

Post Reply