Error 1219 occurs when I try to map a network drive multiple server

Samuel.P picture Samuel.P · Nov 8, 2010 · Viewed 22.8k times · Source

I have a network drive (for instance, G: on Server A). And I am trying to map an additional network drive (H:) to a new server (Server B). I tried the net use command, giving to rise to error 1219 on Window XP.

net use h: \\ServerB\docs /user:ServerB\user Password 

I am connecting the network drive of Server A using Server A's account. And I have to use both of network drive simultaeusly, so I don't think I can the net use * /del command to connect to Server B.

What can I do?

Answer

Kiquenet picture Kiquenet · Mar 13, 2012

Any util commands:

net use (to see all existing connections)

net use * /del /yes (to delete all existing connections)

Script

@echo off

set "svrname=server"
set "share=share$"
set "usr=administrator"
set "pwd=password"

for /f "tokens=2" %%# in ('net use^|find /i "\\%svrname%"') do net use %%# /delete>nul

net use l: \\%svrname%\%share% /user:%usr% "%pwd%">nul