编写批处理以更改映射驱动器的路径

发布于 2024-07-25 04:34:40 字数 95 浏览 3 评论 0原文

我将服务器文件夹作为工作站中的映射网络驱动器。 现在该文件夹正在转移到另一台服务器,因此我需要更改我需要在 400 个工作站上执行的此活动的路径。 那么你能帮我写脚本吗?

I having server folder as a mapped network drive in workstation .
Now the that folder is shifting to to another server so Ineed to change the path this activity I need to do at 400 workstations. so can you help me with script.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彩虹直至黑白 2024-08-01 04:34:40

如果您的旧驱动器映射位于 O: 中,则可以使用它来删除它:

net use /d O:

并使用它来创建新驱动器映射:

net use O: \\newserver\\newpath /PERSISTENT:YES 

如果您必须指定用户名 \ 密码:

net use O: \\newserver\\newpath password /USER:domain\user /PERSISTENT:YES 

If your old drive mapping is in O: you use this to delete it:

net use /d O:

And this to create the new one:

net use O: \\newserver\\newpath /PERSISTENT:YES 

If you have to specify a username \ password:

net use O: \\newserver\\newpath password /USER:domain\user /PERSISTENT:YES 
安稳善良 2024-08-01 04:34:40

给定驱动器号 g:

net use g: /delete
net use g: "\\server\share"

在路径周围使用引号很重要,否则带有空格的路径将无法正确映射。

Given drive Letter g:

net use g: /delete
net use g: "\\server\share"

It's important to use the quotes around the path, otherwise paths with spaces will not map correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文