I don't see a property or method in the FileSystemObject for it, but
since you're managing the file yourself, you can always keep a
variable that holds the state and updates when you open/close the
file.

But if you're looking to know if something else has the file open, you
have a trickier situation on your hands I think.  WMI services may
give you a way to do that, as might running a Net command as a
subprocess.  The latter is probably too messy to be worth it though,
and off the top of my head, I don't know how to use WMI to find out if
a file is open by another process.  But the answer to that problem,
figuring out if anything has a file open, is more a question of what
the OS will let you do than what Window-Eyes or the FileSystemObject
will let you do.

On Sat, Apr 09, 2011 at 10:41:53AM -0400, RicksPlace wrote:
   Hi: I have a file I created using the File System Object. I want to
   check the File's state.

   Is it opened, Closed or something else.

   What Property or methods allow checking a file's state in VBS?

   I haven't found anything yet Googling.

   So, if you know anything about checking file state could you point me
   in the right direction?

   Thanks:

   Rick USA

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:[email protected]  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller

Reply via email to