Discussion Locked

Batch Files

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

I have written a batch file as follows:

net use k: \\servername\share
copy file.txt k:
net use k: /del

When I run this from a DOS prompt I get the following message:

There are open files and/or incomplete directory searches pending on the
connection to k:.

Is it OK to continue disconnecting and force them closed? (Y/N) [N]:
--------------------------------------------
How do I get around this message and close the mapped drive. It has to do with the window that opens for the Kdrive. If I close the window while the file is being copied, I don't get the prompt and the batch completes OK. Thanks

3 replies

by syscokid

Is K: already mapped? Try a different drive letter.

Anyway,

echo y| copy file.txt K:

ought to get by it.

by gcheels

I don't have a problem mapping the drive. My problem is with disconnecting the mapped drive. I solved the problem with a registry edit and SP3. Thanks anyway.

This discussion is closed to new replies.