I need to copy a directory on all the machines on a specific LAN (192.168.0.0/24), but then again the IP are set via DHCP so I don't know what addresses are assigned at a given point in time.
Also, hosts are not up at the same time. Some of them run by night, others by day etc...
Therefore I want to write a script (batch or vbs) that would do the following :
ping all the available addresses from that subnet (from 1 to 254)
if the ping test is positive, checks if "destination path" doesn't exists and then copy "Source Dir" to \\192.168.0.x\C$\Path...
if the ping test is negative, puts the ip 192.168.0.x into a text file like retry.txt
then start from the top, but using the ips from the file retry.txt this time.
Then I'd run that script as a task, like every 12h, and in the long term all the hosts from that subnet would have their dirs updated.
Hope I am making sense ...