0

我有一个批处理文件,开头有以下代码

@ECHO OFF
net use x: \\server1\f$ /user:XXXXXX *   

当我从 cmd 提示符运行批处理文件时,它要求输入密码,并且密码已成功验证,然后是System error 1219 has occurred Multiple connections to server or shared resource by same user, using more than one username is not allowed.

但是当我从运行命令复制相同的路径并按回车键,然后输入用户名和密码时,我可以登录到该服务器。

我需要在批处理文件中做任何事情吗?

4

3 回答 3

0

I had a similar issue. As other answers have indicated, the issue for me was that I already had a connection to the server in question.

Per the response by Kevin vk on this MSDN Forum Post, I used net use to see the existing connections that I had. This showed me that I had a mapping that I was unaware of and was able to remove using the following command, as JohnD mentioned:

net use drivename: /d

I was then able to run my original connection command without error. It might be worth checking to see if you have an existing connection that you're not aware of.

于 2014-04-25T22:02:10.143 回答
0

我最近收到了相同的错误消息,但在不同的程序中。原来是 DNS 问题,因为我能够使用 IP 地址而不是实际的服务器名称。

希望这可以帮助。

肖蒂

于 2013-10-18T12:44:41.150 回答
0

我不清楚在第二种情况下你在做什么。

但是,当您连接相同的网络资源两次时会导致该错误。当您遇到错误时,您已经与该资源建立了连接。为避免该错误,您需要删除连接。您可以通过执行以下操作来做到这一点:

net use \\server1\f$ /d

然后尝试再次运行批处理文件。

于 2013-10-16T18:12:24.427 回答