simultaneous file copy

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
technotika
Posts: 10
Joined: 02 Jun 2011 06:22

simultaneous file copy

#1 Post by technotika » 27 Dec 2013 08:16

Hi I have a script that requires multiple PC's to copy files from a server to their C drives. I can loop it in a list of hostnames but I want the file copy command to to cycle through the list of hostnames without waiting for the files to copy - hope that makes sense.

ECHO on
color 1f
pushd %~dp0

for /f %%A in (%~dp0hostnames.txt) do (

ECHO LISTING ONLINE HOSTNAMES.....
ping -n 1 %%A | find "Reply from"
if not errorlevel 1 echo %%A >> %~dp0online.txt
if errorlevel 1 echo %%A >> %~dp0offline.txt

CLS
)
echo ENTER ADMIN ACCOUNT...
pause
SET /P dollar=[user]
SET /P pword=[password]
cls
ECHO EXECUTING SILENT PROGRAM 3.2.17.17 / FILE COPY

for /f %%A in (%~dp0online.txt) do (

xcopy /herky cmd "%~dp0client.bat" "\\%%A\C$\windows\temp"
xcopy /herky cmd "%~dp0Lexacom.exe" "\\%%A\C$\windows\temp"
xcopy /herky cmd "%~dp0Lexacom3.cfg" "\\%%A\C$\windows\temp"


ECHO "INSTALLING LEXACOM 3 on %%A SEE (%~dp0%%A-log.txt)"

%~dp0psexec.exe \\%%A -u %dollar% -p %pword% "C:\windows\temp\client.bat" > %~dp0%%A-log.txt 2>&1


)

CLS
ECHO LIST OF HOSTNAME INSTALLS COMPLETE CHECK LOGS FOR ERRORS

pause

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: simultaneous file copy

#2 Post by penpen » 27 Dec 2013 13:02

I#m not sure, but do you search for something like this?

Code: Select all

for %%a in (1 2 3) do (start cmd /C "echo copy cmd pc %%a!&pause")


penpen

Post Reply