Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > unmounting a network drive

Reply
Thread Tools Display Modes

unmounting a network drive

 
 
sacrlc
Guest
Posts: n/a

 
      12-04-2009
A batch job does the following:

net use x: \\<servername>\e$
copy file.txt \\<servername>\e$\<directory>\
sleep 20
net use x: /delete


We find residual cmd and net processes left running after the "net use x:
/delete" however there is no sign of the drive. It's like it unmounted the
drive but for some reason did not close out the "net use" command. The drive
cannot be found mounted no matter how you look, and yet the same drive letter
can be re-used without reboot.
Not all our servers do it and and the ones that do it, don't necessarily do
it every time, but I have to clean out bunches of these since the bat file
runs every hour of every day.
What can be the cause of this and how do I fix it?
Thanks in advance
--
sacrlc
 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      12-04-2009

"sacrlc" <> wrote in message
news:EA5F2DB2-4BF3-4355-AC9F-...
>A batch job does the following:
>
> net use x: \\<servername>\e$
> copy file.txt \\<servername>\e$\<directory>\
> sleep 20
> net use x: /delete
>
>
> We find residual cmd and net processes left running after the "net use x:
> /delete" however there is no sign of the drive. It's like it unmounted the
> drive but for some reason did not close out the "net use" command. The
> drive
> cannot be found mounted no matter how you look, and yet the same drive
> letter
> can be re-used without reboot.
> Not all our servers do it and and the ones that do it, don't necessarily
> do
> it every time, but I have to clean out bunches of these since the bat file
> runs every hour of every day.
> What can be the cause of this and how do I fix it?
> Thanks in advance
> --
> sacrlc


Perhaps you'll find out what's going on by replacing the line
net use x: /delete
with these lines:
echo %date% %time% %UserName% >> c:\test.txt
net use >> c:\test.txt
net use x: /delete 1>> c:\test.txt 2>>&1

Note also that if you run your batch file as a scheduled task then drive X:
is probably neither visible nor accessible. You must use UNC coding for your
scheduled tasks.


 
Reply With Quote
 
DaveMills
Guest
Posts: n/a

 
      12-05-2009
On Fri, 4 Dec 2009 12:11:01 -0800, sacrlc <>
wrote:

>A batch job does the following:
>
>net use x: \\<servername>\e$
>copy file.txt \\<servername>\e$\<directory>\
>sleep 20
>net use x: /delete


I would insert "net use X: /del" as line 1 in case the X: drive is already in
use.
Also use "net use x: \\<servername>\e$ /persistsent:No"

But if your need is a simple as you say just use
copy file.txt \\<servername>\e$\<directory>\
and get rid of the drive mapping.
>
>
>We find residual cmd and net processes left running after the "net use x:
>/delete" however there is no sign of the drive. It's like it unmounted the
>drive but for some reason did not close out the "net use" command. The drive
>cannot be found mounted no matter how you look, and yet the same drive letter
>can be re-used without reboot.
>Not all our servers do it and and the ones that do it, don't necessarily do
>it every time, but I have to clean out bunches of these since the bat file
>runs every hour of every day.
>What can be the cause of this and how do I fix it?
>Thanks in advance

--
Dave Mills
There are 10 types of people, those that understand binary and those that don't.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to manage disk drive letter when conflicting with network drive ? Eric Windows Server 13 12-02-2009 11:04 AM
Cannot copy or save file onto a network hard drive Boog Windows Vista Networking 2 11-06-2009 05:26 AM
Installation to second drive KSchrantz Windows Vista Installation 0 08-26-2006 07:15 PM
Install to second drive KSchrantz Windows Vista Installation 0 08-26-2006 07:14 PM
Partitioning Hard Drive #2 Travis King Windows Vista General Discussion 6 03-14-2006 05:07 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59