Is there something I'm missing? I cannot make this work.
Actual script (which returns error on line 5 the network name cannot be found):
Set bldgServers = CreateObject("Scripting.Dictionary")
bldgServers.Add "HS", "HSA"
Set net = CreateObject("WScript.Network")
net.MapNetworkDrive "G:", "\\" & bldgServers(LCase(Left(net.ComputerName, 2))) & "\Software"
I have also tried changing net to objNetwork which doesn't return an error, but also does not map the network drive.
Set bldgServers = CreateObject("Scripting.Dictionary")
bldgServers.Add "HS", "HSA"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "G:", "\\" & bldgServers(LCase(Left(ComputerName, 2))) & "\Software"