从命令行而不是Windows资源管理器命名网络驱动器 [英] Naming network drives from commandline rather than Windows Explorer

查看:114
本文介绍了从命令行而不是Windows资源管理器命名网络驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个批处理文件,以将多个服务器映射到PC上的驱动器.使用NET USE命令,我成功地映射了驱动器.

I'm writing a batch file to map multiple servers to drives on my PC. Using the NET USE command, I have managed to map the drives successfully.

在Windows资源管理器中查看时,每个驱动器都会显示字母分配和服务器名称.我也想在资源管理器"视图中为每台服务器显示一个用户友好的纯英文名称(这与卷标不同).我可以在资源管理器中右键单击每个驱动器,然后重命名,但这有点冗长.

When viewed in Windows Explorer, each drive shows the letter assignment and the server name. I'd like to display a user-friendly plain-English name for each server in the Explorer view also (this is different from the volume label). I can right-click on each drive individually in Explorer and rename but this is a bit long-winded.

是否可以通过命令提示符(因此也可以从批处理文件)将名称分配给驱动器,而不是在资源管理器中右键单击并重命名?

Is there any way that names can be assigned to the drives from the command prompt (and therefore from a batch file) rather than right-clicking and renaming in Explorer?

推荐答案

映射的网络驱动器的标签"值存储在注册表中.

The "label" value for a mapped network drive is stored in the registry.

查看HKEY_USERS \ * SID * \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ MountPoints2.应该有一个代表映射的网络驱动器的密钥.如果有一个名为_LabelFromReg的值,则您有一个自定义标签,如果没有该值,则它将使用默认标签,例如Windows(\ server \ share)(Z:).

Look into HKEY_USERS\*SID*\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2. There should be a key that represents the mapped network drive. If there is a value called _LabelFromReg you have a custom label and if the value is not there then it uses the default label, such as, Windows (\server\share) (Z:).

您还应该能够使用组策略首选项以及网络文件夹和快捷方式"来获取所需的标签.

You should also be able to use Group Policy Preference, and Network Folders and Shortcuts to get the labels you want.

这篇关于从命令行而不是Windows资源管理器命名网络驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆