Reconnecting a network drive that is automapped upon logon (remembered connection)

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
I'm sure some of you know that if you map a persistent network drive and then cycle your logon, you log back on and can see the drive in My Computer but it isnt actually connected- no stats are available and you cannot, for instance, say:

System.Diagnostics.Process.Start("drive:\path\to\app.exe")


If you open the path in explorer (i.e. double click the icon in My Computer), the drive is reconnected using the stored username and password and all will work fine

Does anyone know if I can do something programmatically to reconnect the drive (not remap it, just conenct it/auth it) because right now one of my loaded-on-startup apps is failing as it is trying to start a program on a remembered but disconnected drive

tia!
 
May be these api can give you some help:

WNetRestoreConnection: To restore the network connection

And also might need

IsNetDrive: Determining the Connection State of a Mapped Drive
InternetGetConnectedState: Determine Network Connection Type
IsNetworkAlive: Determine Network Connection State
[FONT=verdana, arial]http://vbnet.mvps.org/code/network/isnetworkalive.htm[/FONT]
 
brilliant, thanks! I'll post any working code i generate for others who have this issue..
 
Back
Top