This works for me...

Code:

Dim $fso, $d, $dc
$fso = CreateObject("Scripting.FileSystemObject")
$dc = $fso.Drives
For Each $d in $dc
If $d.DriveType = 3
If WriteProfileString(@SCRIPTDIR+"\netdrives.ini","DRIVES",$d.DriveLetter,$d.ShareName)
"Error: " + @ERROR + ' | ' + @SERROR ?
EndIf
EndIf
Next