Private Sub CommandButton1_Click()
Dim f As Integer, a As String, t As Single
On Error Resume Next
Kill CurDir$ & "\report.txt"
On Error GoTo 0
Shell Environ$("COMSPEC") & " /C " & "NET USE > " & Chr$(34) & CurDir$ & "\report.txt" & Chr$(34)
'delay for the file to be created
t = Timer
Do While Timer - t < 1
DoEvents
Loop
f = FreeFile
Open CurDir$ & "\report.txt" For Input As f
a = Input$(LOF(f), f)
Close f
MsgBox a
Kill CurDir$ & "\report.txt"
End Sub
HTH Hugh