How can I know if a NAS is connected to my Home Network?

Hi Scripting Guys! I have a Scheduled Task that wakes every my PC on my Home Network overnight and runs an Excel macro workbook.  The workbook resides on a NAS which is connected to my Home Network.  Sometimes, when a PC wakes, it is slow to (re)connect to the network.  In that case, the workbook cannot be opened and the script dies.  I'm thinking that, rather than immediately attempt to hit the NAS, I could run a local copy of a VB script which would check network/NAS availability and, if needed, wait a short period for the network connections to be reestablished and, once that happens, the script could kick off the Excel macro workbook.

I suppose I could just repeatedly attempt to open the Excel file and give up after a minute or so of repeated failures.  But that seems pretty lame.  ;-) 

So how do I determine if the NAS (or if the Excel file I'm trying to open) is reachable before I attempt to open the Excel macro workbook? 

Thanks,

cw

September 10th, 2015 1:50pm

Hi,

Here's a PowerShell method you could use:

http://ss64.com/ps/test-path.html

Free Windows Admin Tool Kit Click here and download it now
September 10th, 2015 1:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics