Xcopy - from server share to multiple IP's using batch file (not working)
Posted on 2016-09-12
I'm using a script created by OdBA, which I then modified based on the help I got here. I am merely trying to copy the files from a server share on a domain to multiples of PC's on the same domain.
Here is the script. In the location C:\Temp\machines.txt is where I put the IP address of the computer(s). I've only put one IP in there for now. The script runs, but nothing is copied.
>"%LogFile%" echo "Machine","State","Errorlevel"
for /f %%a in ('type "%MachineFile%"') do (
echo Processing %%a ...
ping.exe -4 -n 2 %%~a | find /i "TTL" >NUL
if errorlevel 1 (
>>"%LogFile%" echo "%%~a","Offline","n/a"
) else (
ECHO xcopy \\server\share\filename \\%%~a\c$\temp /e
>> "%LogFile%" echo "%%~a", "online", "!ErrorLevel!"
Any ideas guys?
Thanks a lot