ping and then copy files

Microsoft Windows xp pro with sp3 multil...
April 15, 2010 at 01:48:29
Specs: Windows XP
Hi i was wondering if anyone knew a batch file to ping a list of computers and then if there is a reply to copy a file over. Then have a txt file of what pc's had no reply.

i have a batch file to ping the pcs and give me a txt file but i'm strugg;ing to get one to ping and then copy files

See More: ping and then copy files

Report •

April 15, 2010 at 03:30:53
Sounds entirely possible, but you will need to be a little more specific on the details.......

Post you script and an example of the basic format of the list of computer names.

With the details it will become a lot easier to write a script/give advice.

Report •

April 15, 2010 at 03:38:09
here is the script i have to ping the pcs and write a txt file but i want to be able to add in the option of copying a file to the pcs once they give a reply.

@echo off
set Computers=C:\scripts\computers.txt
Echo Computername,IP Address>Final.csv
setlocal enabledelayedexpansion

for /f "usebackq tokens=*" %%A in ("%Computers%") do (
for /f "tokens=3" %%B in ('ping -n 1 -l 1 %%A ^|findstr Reply') do (
set IPadd=%%B
echo %%A,!IPadd:~0,-1!>>final.csv

i know the basic command to copy a file over using xcopy but i'm not sure how to incorporate it. I hope this makes things clearer

Report •

April 15, 2010 at 04:53:19
@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in (complist) do (
ping %%a | find /i "reply" > nul
if errorlevel 1 (
>> noreply.log echo %%a
) else (
copy myfile %%a

Helping others achieve escape felicity


Report •

Related Solutions

April 15, 2010 at 05:21:10
thanks for that
i dont seem to be able to get it working at the minute but at least i'm closer now and now its possible

Report •

Ask Question