General discussion

Locked

Open file date with VBScript + WMI?

By systems ·
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!!!

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Scoob In reply to Open file date with VBScr ...

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

Collapse -

Open file date with VBScript WMI?

by john2r In reply to Open file date with VBScr ...

Thank You!!

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Forums