Skip to content

Instantly share code, notes, and snippets.

@t2psyto
Created July 26, 2021 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t2psyto/6fc1fa189ebd66e5d673317af68917a7 to your computer and use it in GitHub Desktop.
Save t2psyto/6fc1fa189ebd66e5d673317af68917a7 to your computer and use it in GitHub Desktop.
rename displayname of windows network drive
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