Force disconnect in netlogon batch file...

Discussion in 'Server Networking' started by Peter Bako, Apr 5, 2006.

  1. Peter Bako

    Peter Bako Guest

    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
     
    Peter Bako, Apr 5, 2006
    #1
    1. Advertisements

  2. Hi,
    try /yes.
     
    Juergen Heckel, Apr 5, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.