You sir, are a genius. I could have sworn that I had already looked at the Ping function - but probably when I wasn't looking for the tokens and delims coding.

I have tested it and the coding works without any errors and wants to try and shut down any computers online and on the local network. I remmed out the shutdown part temporarily while testing. As bad luck would have it, nobody is using the VPN at the moment - as it's nearly 10PM - that is not surprising. So I can't tell yet what the script will do when it finds a pc online but using the VPN range. But it should work.

I have made one change to the Ping Function. I have added the -n 1 so it only pings once in the last section of coding otherwise the script takes about 25 seconds per machine to complete the loop if the computer is not online.

I wonder if that function should be updated as the other two sections of that function have the -n 1 so I suspect it's a typo that it got missed out in the third section. It does make a huge difference to the run time of the script if it only pings 1 instead of 4 times.

I am happy with the Ping script because this particular script will be run as a scheduled task and nobody will be logged onto the server. I think that I may have wscript disabled anyway.

Very pleased with this. I spent hours trying to get the Ping to output the IP Address. Astonishing how difficult this was to do. I actually did look at the Ping function earlier a day or two ago, but I was obviously looking at a different aspect of the function as I don't recall seeing the tokens and delim coding when I looked at it. Ironic as this was where I was having problems.

Thank you for helping me get there.