Post by Justin Richafter digging in to this a bit more im thinking this might be a little more
difficult than need be.
really my goal is to see if a backup job is done. the problem is i cant do
the standard file open loops because the file is 800+GB, i havent tried yet
but i assume its going to eat up a ton of resources. the box cant really
afford that...
the backup is from DB2 so there isnt a process i can watch or anything like
that.. i just need to see when there is no longer a handle to the file.
Post by Justin Richim looking to get a list of file handles per process.
obviously started with the get-process and it has a handle property but
that doesnt seem to have what im looking for.
basically im looking for an example that will, lets say, tell me what file
WordPad has open.
Thanks
Justin
You can view advanced information on processes using WMI:
PSH>get-wmiobject -query "select * from win32_process where
name='notepad.exe'"
I don't think PowerShell or WMI will help you with determine whether a
particular file is in use. I'd think you'd have more luck using "handle":
http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
It's a DOS binary, so you should have any problems parsing the output
from PoSH.
Marco
--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp
PowerGadgets MVP
http://www.powergadgets.com/mvp
Blog:
http://marcoshaw.blogspot.com