How to rename or relabel a Network Drive label

前端 未结 3 481
-上瘾入骨i
-上瘾入骨i 2020-12-20 07:20

I am mounting a network drive to windows using WNetAddConnection2 which is working fine but while mounting the drive by default it assigns the name as Server IP and FolderNa

3条回答
  •  失恋的感觉
    2020-12-20 08:11

    Not sure if there's an API for this but the strings are stored in the registry under:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2

    Find the correct subkey by parsing the keys there (it will probably look like "##172.24.17.116#NDSTestFolder" ) and change the _LabelFromReg value to whatever you like...

提交回复
热议问题