Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

There seem to be two approaches, both listed in this question/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow questionquestion, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.

There seem to be two approaches, both listed in this question/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow question, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.

There seem to be two approaches, both listed in this question/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow question, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.

replaced http://serverfault.com/ with https://serverfault.com/
Source Link

There seem to be two approaches, both listed in this question/answerquestion/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow question, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.

There seem to be two approaches, both listed in this question/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow question, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.

There seem to be two approaches, both listed in this question/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow question, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.

Source Link
dsolimano
  • 2.9k
  • 2
  • 23
  • 37

There seem to be two approaches, both listed in this question/answer at ServerFault. I much prefer the VBScript approach, which is also described here.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "your_label"

So I would create a small VBScript script, which takes the drive letter as one parameter, and the new label as the second. My VBScript is rusty, but according to this Stack Overflow question, something like this:

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace(WScript.Arguments.Item(0)).Self.Name = WScript.Arguments.Item(1)

If you call that rename_drive.vbs, you can execute it as

wscript rename_drive.vbs H:\ new_drive_name

Of course, if you're comfortable creating COM objects from Java, you can do that directly.