Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

view process file handles

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 05-14-2008   #1 (permalink)
Justin Rich
Guest


 

view process file handles

im 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



My System SpecsSystem Spec
Old 05-14-2008   #2 (permalink)
Justin Rich
Guest


 

Re: view process file handles

after 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.

"Justin Rich" <jrich523@xxxxxx> wrote in message
news:O6yI$HdtIHA.672@xxxxxx
Quote:

> im 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
>
>

My System SpecsSystem Spec
Old 05-14-2008   #3 (permalink)
Marco Shaw [MVP]
Guest


 

Re: view process file handles

Justin Rich wrote:
Quote:

> after 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.
>
> "Justin Rich" <jrich523@xxxxxx> wrote in message
> news:O6yI$HdtIHA.672@xxxxxx
Quote:

>> im 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/s.../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
My System SpecsSystem Spec
Old 05-14-2008   #4 (permalink)
Justin Rich
Guest


 

Re: view process file handles

that should cut it, thanks

"Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
news:ubrxVBetIHA.3968@xxxxxx
Quote:

> Justin Rich wrote:
Quote:

>> after 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.
>>
>> "Justin Rich" <jrich523@xxxxxx> wrote in message
>> news:O6yI$HdtIHA.672@xxxxxx
Quote:

>>> im 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/s.../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

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: The Process cannot access the file ... Shay Levy [MVP] PowerShell 3 08-08-2008 04:11 AM
corrupt windows host process file ???? NURSEASHLEYN Vista General 2 03-12-2008 06:22 AM
How to close open file handles? Hal Rottenberg PowerShell 0 01-25-2008 07:35 AM
deleting file 'in use by another process' in Vista fizzy12 Vista file management 8 11-04-2007 10:02 AM
View a Print-To-File File ajmplanner Vista print fax & scan 4 01-10-2007 08:47 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51