' Input the server name you want to check varServer = InputBox("Server name to check") ' get the local path of the file to check varFile = InputBox("Full path and filename of the file on the " & _ "serer (use the local path as if you were " & _ "at the server console)") ' bind to the server's file service Set objFS= GetObject("WinNT://" & varServer & "/lanmanserver, fileservice") ' scan through the open resources until you locate the file you want varFoundNone = True 'use a FOR EACH loop to walk through the open resources For Each objRes in objFS.Resources ' does this resource match the one you are looking for? WScript.Echo "test " & objRes.Path If objRes.Path = varFile Then ' you found the file. Show who's got it varFoundNone = False WScript.Echo objRes.Path & " is opened by " & objRes.User End If Next ' if you didn't find the file open, fisplay a msg If varFoundNone = True then WScript.Echo "Didn't find that file opened " & "by anyone." End If