Question Locked

Windows XP doesn't see mapped drive from batch file...

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a few computers running Windows XP (NTFS) with a couple mapped drives to a backup computer. I run a batch file that uses xcopy to copy some files to the backup computer. Frequently, the batch file returns an "invalid drive specification" error (especially after the client computer has been rebooted). It doesn't see the mapped drive. But, if I open Windows Explorer and click on the mapped drive it opens and shows the files and folders. Then if I run the batch file it sees the mapped drive and copies fine.

How can I force Windows to see the mapped drives all the time so this doesn't occur?

10 replies

by chris910

The issue might be in the timing. Try using the Start /wait [command][parameters] to run your mapping statement to ensure that it completes before the copy operation is started.

by jdclyde

All part of their "security" fixes, I would bet.

Do the remote systems require a password to access them? There seems to be no rime or reason to what XP will and won't remember the password to.

If the windows login password is the same as the one needed to access the remote system, I have found it more LIKELY to remember it (regardless of if you selected the little check box to remember the password or not).

by bincarnato

Put this at the begining of you batch file, before the xcopy

net use x: /delete
net use x: \\targetsystem\share

"x" would be the drive letter you have the map setup as.

by al-zines

Thanks, I like that. I will give this a try. I assume this way I don't have to have a mapped drive showing in My Computer, which is fine.

by bincarnato

All deleting the mapped drive first in your batch file is doing is preventing the error that says drive is already in use, which would be an issue, if it has lost connectivity from a destination machine reboot or whatever. Or if for some reason the drive letter is being used as a mapped drive to somewhere else.

by al-zines

I may have finally found a workaround in the MS KB at http://support.microsoft.com/kb/297684 :

open a command prompt, type the following line

net config server /autodisconnect:-1

I'll give it a try on a couple machines for a while and see if this keeps the connection alive all the time.

by al-zines

It would be good not to have mapped drives appear in Explorer...it's not really necessary. I can access the remote drive from the Run box when I need to view the remote folders. I assume if I disconnect the mapped drives in Explorer I can still connect when I run the batch file if I include:
net use x: /delete
net use x: \\targetsystem\share

Does this sound right?

by bincarnato

You can also add the delete line again at the end if you do not want or need access to the drive except for during the data copy.

This discussion is closed to new replies.