Here is a more general approach. Put a list of hosts (or their ip addresses) in file C:/Hosts.txt.
Code:
# Script HostsScript.txt
var str hostlist, host, path
# Read the list of hosts.
cat "C:/Hosts.txt" > $hostlist
# Go thru the hosts one by one.
while ( $hostlist <> "")
do
# Get the next host to process
lex "1" $hostlist > $host
# Create the path to file. It will be in one of the following two formats.
# //host1/path/to/file
# OR
# //1.2.3.4/path/to/file
set $path = "//"+$host+"/path/to/file"
# Write string to file.
echo "string to be added to file" > { echo $path }
done
Script is in biterscripting. Please test first. To test, save the script in file C:/Scripts/HostsScript.txt, then enter the following command in biterscripting.
Code:
script "C:/Scripts/HostsScript.txt"
Of course, you need to have access permissions to the path on each of the hosts.
Bookmarks