I administer a hospital network using a Win2003 domain. I have a requirement
to also provide service for some applications to medical offices that are not
part of my domain. Most of these offices connect to my domain using either a
client or a site-to-site VPN.
To connect to a recent deployed application I wrote a VB script that maps a
drive then calls the application. Problem is that sometimes the application
starts before the drive is mapped. Some of the VPN connections are slow and
it may take 30 secs or more to get the drive mapped. When this happens the
application fails to run.
How can I change my script so that the application is not called until the
mapping is successful?
My script follows.
'***********************************************************************
'Script: HealthPort_Map
'This script maps a drive for healthport then calls the application
'************************************************************************
On Error Resume Next
Dim objNetwork, objShell
Set objNetwork = CreateObject("WScript.Network")objNetwork.MapNetworkDrive
"Z:", "\\Nazgul\Healthimages",,"NVh1\password"
Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.Run "C:\HP.lnk", 1, True
--