1

On a Windows Server 2003, I keep losing the connection to the network drives - or to be more specific - they disconnect.

Now I can simply log on and double-click the network drives, and they without problems - but they will disconnect again later.

This causes a problem for apps trying to access these network drives.

How can I make sure the drives stay connected, and reconnect automatically if it (for some reason) disconnects?

Kjensen
  • 1,039
  • 10
  • 28
  • 39

2 Answers2

3

This problem had been giving me significant grief with a number of automated scripts that would just plain fail when the network mapping wouldn't be re-established.

Instead I went back and altered a number of scripts to use the UNC long path format instead of a mapped drive - this solved my problems without actually resolving the problems with drive mappings. I.e. instead of referring to a file as N:\something\something.txt I would refer to it as \\GOOFY\MyShare\something\something.txt.

PP.
  • 3,316
  • 6
  • 27
  • 31
2

First of all, have a read of the KB article here: http://support.microsoft.com/kb/297684

This is a default and built-in behaviour of Windows server and is intended to prevent unnecessary use of server resources.

Now, the question of why your apps need a mapped network drive and why they're not connecting via UNCs needs to be asked and answered.

Assuming however that there is a valid reason for this, one possible approach would be to have a regular job that keeps the mapped drive "warm", e.g. by dropping a 1 byte file on it every 10 minutes (overwriting the previous 1 byte file from 10 minutes ago).

But I would still ask why apps need drive mappings though.

Maximus Minimus
  • 8,987
  • 2
  • 23
  • 36