10

I have a few network drive mappings that I want to be available to various programs upon reboot. However, they remain disconnected until I visit them manually.

If a program, such as OneNote which reads notes shared on a network drive, tries to connect, it does not see the share and does not cause auto-reconnect.

I am looking for a fully automated solution, preferably just a setting to make Windows natively reconnect on machine boot.

For example, right now drive Y and Z are disconnected and X is connected because I accessed it manually:

alt text

Edit: I have to change my question slightly but with quite a significant impact on the answers. The drives are indeed NOT available at logon. They only become reachable after I open an ssh tunnel.

Therefore, the main question is - how do you make applications force the drive alive when they try to access it?

I guess another approach would be to automatically run a script when the tunnel gets established. It's probably my best bet if the above is not possible.

6
  • 1
    Have some rep for the question, it's definitely one that's frustrated a lot of folks over the years and is therefore a good one to bring up. Aug 6, 2009 at 19:44
  • Thanks, yeah, it's been bothering me for a few years and now that SF is here, it'll get resolved. Aug 6, 2009 at 20:00
  • Maybe this is an obvious question, but are you tunneling netbios shares over ssh? If so, with what software? I'm not seeing why connecting to a share depends on ssh...
    – romandas
    Aug 6, 2009 at 21:07
  • romandas - yes, I'm mounting remote samba mounts using a dynamic ssh tunnel (established via putty, SecureCRT, or whatever you want). Aug 7, 2009 at 0:08
  • @Artem - That would be good information to include in your question.
    – romandas
    Aug 7, 2009 at 2:27

4 Answers 4

2

Read this thread: https://web.archive.org/web/1/http://techrepublic%2ecom%2ecom/5208-11184-0.html?forumID=47&threadID=178558&messageID=1818197. The guy basically says to change this:

Try [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters]

"KeepAliveTime"=dword:00300000
"KeepAliveInterval"=dword:00001000

We used to have a similar issue at my last place and this seemed to help.

Hope this helps.

1
  • This seems not to be the solution to the actual problem, but for a related, so +1. This is soo anyoing that normal file API calls does not reconnect shares. Sometimes Explorter refresh (F5) does, but sometimes not even that. Then only net use can help which is hard to automate for all programs. :-/
    – eckes
    Oct 26, 2012 at 0:38
2

Well, first of all, while mapping the drive you could tick the checkbox saying XP should reconnect the drives. It's not perfect. The other option is to write a script and place it in user's Startup folder:

net use * /d /y
net use <DriveLetter> <Path> (i.e. G: \\server\folder)
<repeat as many times as needed...>
2
  • +1 - Ticking the 'reconnect at logon' box, and ensuring the credentials used for logging in are the same for connecting to the share seems to work for me. I map my iTunes library to a fileserver and have never had to go to the share before launching iTunes.
    – romandas
    Aug 6, 2009 at 19:38
  • I have edited the original question which clarifies the issue. Aug 6, 2009 at 20:06
1

We encountered issues with this where we had a 2003 file share mounted in a Unix filesystem. The "disconnect" would happen, and jobs that used it would potentially end up having to be run twice - the first time to wake up the share, the second time to actually do the job for real.

This wasn't satisfactory as - of course - sometimes the first run worked, so in the end one of our developers ended up writing a job to regularly poll the share and keep it warm. Note that in this case changing keepalive times on the server wasn't an option as the share was mounted in the filesystem, and jobs could potentially have gaps of up to a week or so between them.

Why they didn't just connect at the start of each job and disconnect when done, or wake up the share via another method before running the actual job, I can't say.

Anyway, I'm not certain of the implementation details, but I expect that a scheduled task that just retrieves a directory listing would have the same end result for a Windows client if you were going to go down that route. It's one way of doing it, but I'm sure there are better.

The moral of the story anyway is that Unix/Windows interoperability sure ain't as seamless as some folks would have you believe. But that's digressing from the question.

1

Are they accessible if you try to open them? AKA, is this the age old issue of a mapped drive appearing to be disconnected, but when trying to open it, you find that it actually is connected?

But to answer the question as i read it:

To map a drive from a command prompt, and have it remain after a reboot, is to make it persistent.

NET USE <driveletter:> \\computername\share -p

Or, right click on My Computer, click map network drive, choose the location, and make sure "Reconnect at logon"

1
  • I have edited the original question which clarifies the issue. Aug 6, 2009 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .