Solved

Restoring Disconnected Network Drive via VB.NET

Posted on 2008-10-22
2
435 Views
Last Modified: 2013-11-07
I have a VB.NET (.NET Framework 2.0) program launching every minute on a Windows 2003 server and processing files from a remote server.  It accesses the files via UNC (e.g, \\SERVER22\\exports\rcv or \\149.44.76.2\exports\rcv).  The program launches fine for days but then gets "stuck".  When I log in to the server I always find the equivalent mapped network drive to be "disconnected".  Killing the app's process and executing the app manually confirms it can't access the UNC resource (it just hangs).  I have to double click the mapped drive in Explorer to reconnect the drive and then launch the app.  This might be acceptable if it happened once a month but the problem occurs in bunches.  The last two weeks were fine but I've now had three network drive disconnections in the last 24 hours.

How can the app ensure the UNC resource is available and if it isn't, do the necessary reconnection?
0
Comment
Question by:AdvizeIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
ccpjc earned 250 total points
ID: 22778953
I have the same issue on one of the computers here at the office
i made a bat file that re maps the drive and a scheduled task to check every 10 minutes
0
 

Author Comment

by:AdvizeIT
ID: 22779364
Thanks.  I've added a NET USE before the app kicks off and a NET USE DELETE after it completes.  If it works for the next 24 hours, I'll award the points.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question