Mike Copeland <[email protected]> wrote:

>Tracy,
>
>Not sure if you're still having trouble with this, but I wrote a VFP 
>chunk of code that uses Windows Scripting when the appropriate error is
>
>triggered. The code (with WScript) checks for the "missing" drive map, 
>removes it if it is known to exists (because it will be dead) and then 
>reconnects the link. It has helped a lot.
>
>Here it is in case anyone else can use it.
>This is  part of my error handling routine.
>
>para tnErrorNo
>IF tnErrorNo=1 OR tnErrorNo=1104
>     * network drive has gone away
>     oNet = CreateObject("WScript.Network")
>     * get list of mapped drives
>     * this will return an object with an array property "item"
>* Item is a zero-based associative array of "drive letter" = "map path"
>     * so loDrives.item(0)= 'Z:'
>     *    loDrives.item(1)= '\\192.168.0.25\c\'
>     loDrives=oNet.enumnetworkdrives()
>     IF loDrives.count>0
>         FOR nnum=0 TO loDrives.count STEP 2
>             IF lodrives.item(nnum)='S:'
>                 * force removal in case it exists
>                 oNet.RemoveNetworkDrive("S:",.t.)
>                 exit
>             ENDIF
>         ENDFOR
>     ENDIF
>     RELEASE ALL LIKE loDrives
>     * reconnect.....the third param is for "persist? y or n"
>     oNet.MapNetworkDrive("S:", appl.serverpath,.t.)
>     RELEASE ALL LIKE onet
>     On Error &lcError
>     retry
>ENDIF
>
>Mike Copeland
>

This actually has some merit. I'll see about getting this tweaked for my 
situation. The drive will need to be captured at startup. 

I'm at DEVLink the rest of the week.

Thanks
-- 
Tracy Pearson
PowerChurch Software

Sent from my Android phone with K-9 Mail. 

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to