Close files opened by another app

  • Thread starter Thread starter ssg31415926
  • Start date Start date
S

ssg31415926

I've just had a colleague ask me this one: is it possible to close
files opened (and left open) by another app, programatically? I know
it must be possible because NET FILE can do it as can Computer
Management.

I can't find an obvious place to start in .NET - is there one? I came
to .NET via scripting and haven't ever done Win32 stuff. Can anyone
point me towards a place to start?

Cheers

SSG
 
If NET FILE will do what you want, then you can just call that on the command
line from your app via Process.Start.
Peter
 
Hi,

I dont think this is possible. at least with managed code.

Of course if you find a method to force win to release the handle of that
file then the file will be considered "closed" and you can open it. Not sure
how to do this (even if possible) though.
 
Thanks. Yes, I could do that but it's not very nice! I was hoping for
something a bit more elegant! Yes, I know, if it works...

SSG
 
Back
Top