Discussion Locked

Open file date with VBScript + WMI?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Similiar to another post looking for share information, only I am looking to grab the "Open Files" information. (This can be viewed on XP by right clicking my computer, click manage, then shared folders, open files)

The Win32_ServerConnection will allow me to see who is connected to the share and how many files they have open but I can't seem to find exactly what files they are.

I will be doing this through a VBScript to check if a folder or files inside the folder are in use, and by whom, before I overwrite it. Any help provided would be greatly appreciated.

Thanks!!!

2 replies

by scoob

This should do the trick: Just add your server name in the objServerObject assignment.

Set objServerObject = GetObject("WinNT://PUT SERVERNAME HERE/LanmanServer")
If (IsEmpty(objServerObject) = False) Then
iCounter = 0
For Each objresource In objServerObject.resources
If (Not objresource.User = "") And (Not Right(objresource.User,1) = "$") Then
iCounter = iCounter + 1
wscript.echo iCounter & " -> " & objresource.user & " " & objresource.path
On Error Resume Next
End If
Next
Else
WScript.Echo "Object Empty"
End If

This discussion is closed to new replies.