D
D
Danil2017-09-14 16:10:42
System administration
Danil, 2017-09-14 16:10:42

How to rename a drive from the command line?

I added it via a net usenetwork drive, it looks like a user Lan_Disk(\\192.168.0.2), how can I rename it from the command line?
It needs to work without admin rights.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil, 2017-09-14
@Veneomin

There is no standard solution. Chose the solution through the registry:

chcp 1251 <- Это для того, чтобы кирилица адекватно отобразилась в лейбле
net use X: /DELETE <- хак для работы сетевого диска
net use X: \\192.168.0.2\My_Unreadble_Share_Folder
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##192.168.0.2#My_Unreadble_Share_Folder/t REG_SZ /v _LabelFromReg /d "Прекрасно читаемый лейбл" /f <- Собственно добавляем лейбл

This prompted the decision. This helped me decide .

S
Sergey Odrikovsky, 2017-09-14
@eteh

Renaming without administrator rights will not work, because you need to make changes to the registry:
1. manually fix HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##WorkStation#Open
where WorkStation is the computer name and Open is the name of the network drive;
2. create bat file
net use
g: \\WorkStation\Open
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##WorkStation#Open /v _LabelFromReg /t REG_SZ /d "Required name" /f

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question