I want to change the volume label of the virtual drive that I created with subst.
The following command is known to be unable to change the letter created by subst
@echo off
subst x:c:\personalfiles
wmic logicaldisk where "deviceid= ' X: '" Set volumename= "Development"
Pause
But you can use this VBS script to change
Set Oshell = WScript.CreateObject ("shell.application")
oshell.namespace ("X:\"). Self.name = "Development"
To be honest, VBS is unfamiliar with ...
I changed it so that it was not effective:
@echo off
subst x:c:\personalfiles
mshta vbscript:createobject ("Shell.Application"). NameSpace ("X:\"). Self.name = "Development"
Now want to ask how to modify the above script to be effective? Thank you.
BTW: I just want to study the disposal plan of the batch.
After some research, I finally got it done.
: On Error Resume Next
Sub bat
Echo & CLS
' &subst x:c:\personalfiles
start Wscript-e:vbs '%~f 0 "
Exit Sub End
sub
Set oshell = WScript.CreateObject (" shell.application ")
oshell.namespace (" X:\ "). Self.name = "Personal Files"
Explain it, the backslash to escape, the best words should be at the beginning of every line Plus ' & to deal with.