"Ilya Evseev" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi!
> There is a script calling by System Agent that maps external network share
to drive letter.
> When this script fails without unmapping network drive,
> I don't have any possibility to release drive letter.
> Only rebooting has effect, but this is absolutely impossible on server
box.
>
> Scheduled script performs safe checking as following:
> -----------------------------
> if not exist z:\nul goto mapdrive
> net use z: /delete /yes
> if not exist z:\nul goto mapdrive
> echo Error: cannot unmap Z: drive, abort.
> goto done
> :mapdrive
> net use z: \\server\share
> ...
> :done
> -----------------------------
> All output is redirected to file using >>logfile.txt 2>&1
> and contain "Error: cannot unmap" lines preceding by error output of "net
use z: /delete":
> -----------------------------
> The network connection could not be found.
> More help is available by typing NET HELPMSG 2250.
> -----------------------------
>
> Drive Z: is not visible in "My Computer" nor in "net use" output.
> However, "Start->Programs->Administrative Tools->Computer
Management->Logical drives"
> contains record of network drive Z: with "Information not available" hint,
> but this record cannot be deleted anyway.
>
> Script is running under Administrator account, but HKCU\Network does not
contain "Z" subkey.
>
> So, my question is very simple: how to unmap this drive???
> My Windows is 2000 Server SP4 with Terminal Services.
>
> Long live Linux,
> Ilya
Your share is probably mapped to a drive letter by a background
process, e.g. by a scheduled task or by a spawned command
processor. You must ensure that all such tasks unmap all
mapped drives before they terminate.
|