Otro que encontre con VBScript
Código:
<html>
<head>
</head>
<body>
Click para mapear:
<script LANGUAGE="vbscript">
Sub DriveMap()
Set WshNetwork = CreateObject("WScript.Network")
dim matriz (25)
for i=0 to 25
matriz(i)=Chr(i+65)
next
Dim fso, msg
Dim encontrado
encontrado = False
Set fso = CreateObject("Scripting.FileSystemObject")
for i=0 to 25
If fso.DriveExists(matriz(i)) Then
msg = "1" 'existe
Else
msg = matriz(i) & ":"
'msgBox "Letra elegida: " & msg
WshNetwork.MapNetworkDrive msg, "\\servidor\\carperta"
Exit For
End If
next
document.writeln("Mapeado en la unidad " & msg)
Set WshNetwork = nothing
End Sub
</script>
<input type="button" onclick="DriveMap()" value="Click">
</body>
</html>