I've setup a netlogon batch file for users to have two drive letters always
mapped, which is required for some older software deployed on the network.
In the batch file I first disconnect the drives, just in case it was
manually remapped to the wrong location, and then do the connect command.
Basically like this:
-------
net use f: /d
net uise g: /d
net use f: \\<server>\<share1>
net use g: \\<server><share2>
--------
Pretty straightforward stuff and it works 99% of the time. However
occationally the batch file hangs during on of the disconnects and claims
that some process has an open connection on it, which is not likely since
the software that would use these letters does not run in the background in
any way. When it does that we have to manually enter "y" to the are you
sure you want to disconnect message. Is there any way to force the
disconnect via the batch file, regardless of any files that Windows thinks
might be using it?
I checked and there is no -y (for always yes) or -f (for force) command
available to the net use command.
Thanks,
Peter
|