I've been looking for an answer to this myself and have found a "cheap" way of labeling a drive that was mapped using the SUBST command.
I will explain what the script does because I KNOW there has to be a MUCH more efficient way of achieving the same results so I hope someone will post a "cleaner" version of my code.
I discovered that when you map the drive a registry key is added to "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2". The problem is that it appears the name of the key is never the same twice. I have my script read all of the keys under "MountPoints2" and add them to an array. Then I have it map the drive using the SUBST command and then it creates a new array with a list of the new keys and then compares the two until it finds the new key. I then have it add the correct REG_SZ value to name the drive.
#include <Process.au3>
Dim $Before[50], $After[50]
$times = 0;Used to determine how many subkeys there are under the MountPoints2 key
; Take a "Before" snap shot of the subkeys to see what is there prior to mapping the drive
While 1
$times = $times + 1
$var = RegEnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2", $times)
If @error <> 0 then ExitLoop
$Before[$times] = $var
WEnd
; Map the drive and then pause for a second to wait for the system to catch up (it would'nt work without a pause)
_RunDOS("Subst Z: \\server\share"); Change the drive letter and path to suit your needs
Sleep(1000)
; Take a snapshot of subkeys AFTER the mapping
For $i = 1 to $times
$After[$i] = RegEnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2", $i)
Next
; Compare the two arrays line by line until it finds the first discrepency (which is the new key) and write the new label
For $i = 1 to $times
If $Before[$i] <> $After[$i] Then
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\" & $After[$i], "_LabelFromReg", "REG_SZ", "My new label"); Change the "My new label" to suit your needs
Exit
EndIf
Next
I hope this helps out.