2

I want to run handle for a specific folder for a remote pc at my network so to know which processes are locking the folders.

tried:

handle /accepteula \\remotePcName\c:\myFolder

handle /accepteula \\remotePcName\User(name of the account)\c:\myFolder

and some other combinations with no luck getting

No matching handles found.

Is it possible to do this? Run handle for a remote pc?

8
  • is your c: shared out as c:? Is that what shows up when you browse to \\remotePcName? c: would not be a valid path name anyways due to the :. Perhaps you want \\remotePcName\c$
    – Marc B
    Mar 10, 2014 at 16:20
  • Actually I have it shared as C. Tried \\remotePcName\c but still getting No matching handles found
    – C Ts
    Mar 10, 2014 at 16:24
  • and from reading the handle docs, I doubt it can actually work on a UNC path anyways. The sort of information it needs isn't available remotely.
    – Marc B
    Mar 10, 2014 at 16:26
  • So no way to make it work? How about with an IP? Do you have a link for the doc?
    – C Ts
    Mar 10, 2014 at 16:35
  • 1
    you could try psexec to execute a remote copy of handle that's already on that machine. but that's opening a whole diferent ball of wax.
    – Marc B
    Mar 10, 2014 at 16:37

2 Answers 2

0

Could you please try like this:

c:\powershell\Tools\psexec.exe \\remotePcName C:\handle.exe c:\myFolder
0

How about using invoke-command to execute 'handles' remotely?

$serverName = 'serverName'
$pathtoCheck = 'C:\temp' # folder you want to check on the remote server.
$pathtoHandle = 'c:\temp\handle.exe' #location of handle.exe on the remote server.

Invoke-command -ComputerName $serverName -Scriptblock {
    param(
    [string]$handles,
    [string]$pathToCheck
    )
     "$handles /accepteula $pathToCheck" | Invoke-Expression 
    } -ArgumentList $pathtoHandle,$pathtoCheck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.