Reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\#192.168.1.52#office /v _LabelFromReg /t REG_SZ /f /d "Office" Reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\#192.168.1.52#public /v _LabelFromReg /t REG_SZ /f /d "Public" Reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\#192.168.1.52#common /v _LabelFromReg /t REG_SZ /f /d "Common" Reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\#192.168.1.52#xrays /v _LabelFromReg /t REG_SZ /f /d "X-Rays" Note: I have not yet tested how you should handle share names with spaces (or even pound symbols) in them. The key you will be writing to is HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\ with the sub-key being the share path with all of the backslashes replaced with pound symbols (#). So, if the end user later disconnects X: and manually mounts the xrays share to say the R: drive, then the label will still show up correctly (to whatever you assigned it in the script). IMHO, doing it this way will be better than using VBScript to change the label because it will not associate the label with the drive letter, but rather it will associate the label with the share. You can edit the registry using the reg add command. There is way to do it from the command line without using VBScript.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |