Solved script for verify for computers ping & copy files on network

June 17, 2012 at 21:05:09
Specs: window 7
Hi how can I write a script to check multiple computers on the network if they are ping if they are ping then go to the document folder and copy every file to the backup folder and do same thing with every computer on the network. Any help will be appreciate.

See More: script for verify for computers ping & copy files on network

Report •

June 18, 2012 at 20:03:32
✔ Best Answer
First you need a list of the ips. I'm not up to speed on all the ways to get that. If it were to be captured in a file, maybe something like thus:

@echo off & setlocal enabledelayedexpansion
for /f %%i in (iplist.txt) do (
ping -n 1 -w 3000 %%i && copy \\%%i\c\documents\*.* .\backup || >>backlog.txt echo %%i NOT BACKED UP
the settings of -n and -w are up to you, but a lot of time will be wasted waiting on the defaults (4 tries and 5 seconds per try I believe). Also not clear on specifics, so I just gave you a smudged/ambiguous framework. Also, UNTESTED!

Report •

June 19, 2012 at 04:18:57
Here's an approach using Net View to find computers on a LAN:


FOR /F "tokens=* delims=" %%A IN ('NET VIEW^|FINDSTR /B "\\"') DO (
    XCOPY /E /Y "%%A\Document Folder" "%%A\Backup Folder"

When your only tool is a hammer, every problem looks like a nail.

Report •

Related Solutions

Ask Question