Mapping a network drive

G

Guest

Hi,

I'm a network admin for a company running a Windows 2000 Sever SP4. I'm
running a bat file to map a drive to a network share but every month or so I
get the following error:

"An attempt was made to remember a device that had previously been
remembered." - see http://support.microsoft.com/?kbid=328981

According to MS this problem was fixed in SP4 but I'm running SP4 and am
still getting it. The only solution I've come up with so far is to reboot the
machine - which isn't acceptable long-term obviously.

Has anyone any suggestions?

Thanks in advance,
Colm
 
L

Lanwench [MVP - Exchange]

In
Colm Field said:
Hi,

I'm a network admin for a company running a Windows 2000 Sever SP4.
I'm running a bat file to map a drive to a network share

On the server? Or is this a login script for your workstations, as I'd
expect (can't see why a server should be mapping drives anyway).
but every
month or so I get the following error:

"An attempt was made to remember a device that had previously been
remembered." - see http://support.microsoft.com/?kbid=328981

According to MS this problem was fixed in SP4 but I'm running SP4 and
am still getting it. The only solution I've come up with so far is to
reboot the machine - which isn't acceptable long-term obviously.

Has anyone any suggestions?

Thanks in advance,
Colm

What's in your batch file?
I'd use

net use * /del
net use x: \\server\share /persistent:no
net use y: \\server\share /persistent:no
net use z: \\server\share /persistent:no

.....etch.
 
G

Guest

Lanwench said:
In

On the server? Or is this a login script for your workstations, as I'd
expect (can't see why a server should be mapping drives anyway).

Yes, on the server. I'm mapping a drive to an AS/400 IFS share to copy file
generated on it down to an Adobe print server on the server, so no it's not
at log in time that this happens.
What's in your batch file?
I'd use

net use * /del
net use x: \\server\share /persistent:no
net use y: \\server\share /persistent:no
net use z: \\server\share /persistent:no

.....etch.

Here's what's in my BAT file (note that I had the "net use Q: /delete" line
in before the first mapping but to no avail):

:: Parameters
:: %1 - Instance
echo step 1a > s:\pps\BAT\Copylog.txt
set IFSDIR=%1

echo step 1b >> s:\pps\%1\Copylog.txt
if %1==CRK
set IFSDIR=Statements
if not %1==CORK goto skip
set IFSDIR=CRK
echo step 1c >> s:\pps\%1\Copylog.txt
:skip

echo step 2 >> s:\pps\%1\Copylog.txt

:: Map the IFS to the Q: drive using AS/400 username & p/w 'CH'

net use /USER:XXX Q: \\XXX.XXX.XXX.XXX\pps XXX


:: Get a list of all .dat files on the IFS for this instance...
echo step 3 %IFSDIR% >> s:\pps\%1\Copylog.txt

dir Q:\%IFSDIR%\data\*.dat /ON/B > s:\pps\%1\CopyDir.txt

:: ...and copy each file to the control folder on the Document
Production server
:: then delete once copied.
echo step 4 >> s:\pps\%1\Copylog.txt
type s:\pps\%1\copydir.txt >> s:\pps\%1\Copylog.txt

FOR /F %%i IN (s:\pps\%1\CopyDir.txt) DO (
echo Preparing to process file %%i >> s:\pps\%1\Copylog.txt
copy Q:\%IFSDIR%\data\%%i s:\PPS\%1\Control
echo Copied file %%i from IFS to Server >> s:\pps\%1\Copylog.txt
del Q:\%IFSDIR%\data\%%i
echo Deleted file %%i from IFS >> s:\pps\%1\Copylog.txt
)

:: Delete the mapping to the Q: drive

echo step 5 >> s:\pps\%1\Copylog.txt
net use Q: /DELETE
 
L

Lanwench [MVP - Exchange]

In
Colm Field said:
Yes, on the server. I'm mapping a drive to an AS/400 IFS share to
copy file generated on it down to an Adobe print server on the
server, so no it's not at log in time that this happens.

OK - maybe this is a silly question, but why can't you just use a UNC path?
Drive mappings are for the convenience of people, not computers/servers.....
Here's what's in my BAT file (note that I had the "net use Q:
/delete" line in before the first mapping but to no avail):

echo step 1a > s:\pps\BAT\Copylog.txt
set IFSDIR=%1

Where's S ?

echo step 1b >> s:\pps\%1\Copylog.txt
if %1==CRK
set IFSDIR=Statements
if not %1==CORK goto skip
set IFSDIR=CRK
echo step 1c >> s:\pps\%1\Copylog.txt

echo step 2 >> s:\pps\%1\Copylog.txt


net use /USER:XXX Q: \\XXX.XXX.XXX.XXX\pps XXX

Why not

net use q: \\server\share /user:XXX password

.....if you must do this at all?
 
G

Guest

Hey,

Thanks for your help so far.

The reason I use the mapping is as follows:

I need to copy the files on the Q: (the mapped drive) drive to the S: drive
(a local drive from the server's point of view) in filename sequence (the
files are sequentially numbered). The copy and xcopy BAT commands do not copy
in this order. Therefore I decided to write the contents of a DIR to a file
and copy the files down one by one by reading this file. The reason I need
the mapping is because the DIR command does not work with UNC addresses.

Does this make sense?

Colm
 
B

Bob I

UNC works with DIR here. (XP workstation)

Colm said:
Hey,

Thanks for your help so far.

The reason I use the mapping is as follows:

I need to copy the files on the Q: (the mapped drive) drive to the S: drive
(a local drive from the server's point of view) in filename sequence (the
files are sequentially numbered). The copy and xcopy BAT commands do not copy
in this order. Therefore I decided to write the contents of a DIR to a file
and copy the files down one by one by reading this file. The reason I need
the mapping is because the DIR command does not work with UNC addresses.

Does this make sense?

Colm

:
 
G

Guest

Sorry, you're correct. That wasn't the problem exactly though, the problem
was doing a DIR on a server path that required me to log on.

Perhaps there's a way to log on as a seperate step before I do the DIR?
 
B

Bob I

Sorry, I was just replying as to the DIR command, you still need to
authenticate with either method.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top