vb code to show who has a file open on a 2012r2 file server, from a 2008R2 Remote desktop server

I need vb or vba code that can tell me what user has a file open on a 2012R2 file Server Share, from a 2008R2 Remote Desktop Session.

Currently the call IT and we open Shared Folders-Open Files and scroll down to find who has the file open. I want them to be able to either, right click the file and have an option to "Who has this file open" or open a vbs script and pick the file and it tell them who has the file open.

Any help is greatly appreciated.



Does it have to be vbs? A simple cmd could do it. e.g. This sends the results to a csv that you can view in excel:



Does it have to be vbs? A simple cmd could do it. e.g. This sends the results to a csv that you can view in excel:



Thanks, I tried: openfiles /S fileserver /U admin /p password /FO CSV>OpenFiles.csv
it list all the open files on our fileserver (34,000).
I just need to know who has 1 file open.

I'll try to figure out if i can search through the .csv file from vbscript - worth a shot.



You could make a .bat file of it. When you run the .bat:



sweet.

i will give them an interface to run the command: openfiles /query /v /fo table | find /i %1| sort /+27 >files.txt and then open the txt file from vbscript. I'll post my results.

thank you very much.



Hi BFanguy,

Just wondering if you still need help with this...

Share this

Related Posts

There was an error in this gadget