slloyd has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to figure out a scriptable way to determine applications, windows, and dos prompts that are using a particular directory. Any ideas on how this might be accomplished?

Example scenerio: Excel Word has a file in c:\temp open. Also , I have opened My Computer and browsed to c:\temp.
Also, I have a dos prompt opened that is is c:\temp.

I need to figure out a way to close applications, windows, and dos prompts that are using c:\temp so that I can rename it.

  • Comment on Applications, windows, and dos prompts that are using a particular directory (windows)

Replies are listed 'Best First'.
Re: Applications, windows, and dos prompts that are using a particular directory (windows)
by NetWallah (Canon) on Oct 13, 2005 at 04:44 UTC
    Try the free, ready-made FileMon program from the smart folks at SysInternals.

    "FileMon monitors and displays file system activity on a system in real-time. Its advanced capabilities make it a powerful tool for exploring the way Windows works, seeing how applications use the files and DLLs, or tracking down problems in system or application file configurations."

         "Man cannot live by bread alone...
             He'd better have some goat cheese and wine to go with it!"

        There is a MS command-line tool called "OpenFile" that may be useful in this - I have not tried it, but you can find documentation at MS Technet.

             "Man cannot live by bread alone...
                 He'd better have some goat cheese and wine to go with it!"