On our server we have split our disks into:
C: System disk
D: Data disk
E: Archive
T: Temp
In addition we have a fewsubsted drives, both substed to a folder in D:\...:
I: Common
H: Home
And a few mapped network drives:
W: Webserver
X: Appserver
My "problem" is that I relate much more to drive letters than to drive names, so
I've found that I could rename mapped network drives in scripting, but for long not my substed drives
It always comes up as Data (I:). The same name as my physical D: drive
Then I found a comment on this article:
http://www.digwin.com/cant-rename-subst-drive-in-ultimate-32bit
And it turns out that you can only rename substed drive if the drive you are substing to is not named...
So I deleted the "Data" name on our D: disk so that it comes up as "Local Disk (D:)" and now I can rename my substed drive:-)
So my script turned out like this:
set WshShell = CreateObject("WScript.Shell")
Set objShell = CreateObject("Shell.Application")
WshShell.run "subst I: D:\Data"
WshShell.run "subst H: D:\Home\%Username%"
WshShell.run "net use W: \\5.10.1.2\wis pwd /USER:uname /Persistent:No"
WshShell.run "net use X: \\5.10.1.2\wis pwd /USER:uname /Persistent:No"
objShell.NameSpace("E:").Self.Name = "E: Archive"
objShell.NameSpace("I:").Self.Name = "I: Common"
objShell.NameSpace("H:").Self.Name = "H: Home"
objShell.NameSpace("T:").Self.Name = "T: Temp"
objShell.NameSpace("W:").Self.Name = "W: Webserver"
objShell.NameSpace("X:").Self.Name = "X: Appserver"
|