There are 2 workstations at work. Both are configured exactly same. But only the first WS
has a share, and the second WS should map the drives. My boss does every morning the
same mistake and powers on the second WS at first. There is no share to connect, so
if you want to use it you must enter username and password and this costs time

Use this script...

' Create the Network object
Set objNetwork = WScript.CreateObject("WScript.Network")
'adjust this to your requirements... enter ip or name
strComputer = "192.168.2.5"
' Use WMI to connect the services
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
' Loop until the share is accessible
Do
Set colFolders = objWMIService.ExecQuery _
("Select * From Win32_Directory Where Name = 'D:\\Data'")
Loop While colFolders.Count = 0
' Share found, do what you wanna do... ;)
MsgBox("Share on server found !")