Created
July 26, 2021 23:40
-
-
Save t2psyto/6fc1fa189ebd66e5d673317af68917a7 to your computer and use it in GitHub Desktop.
rename displayname of windows network drive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set args = WScript.Arguments | |
Set objWSHApp = Wscript.CreateObject("Shell.Application") | |
if args.count=2 then | |
drive_letter = args.Item(0) | |
drive_displayname = args.Item(1) | |
With objWSHApp.NameSpace(drive_letter + "\").Items | |
.Item.Name = drive_displayname | |
end with | |
else | |
WScript.Echo "usage: " & vbNewLine & _ | |
" cscript rennetdrv.vbs Z: DRIVE_DISPLAY_NAME" | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment