我想在我的网络上为远程 pc 的特定文件夹运行句柄,以便知道哪些进程正在锁定文件夹。
试过:
handle /accepteula \\remotePcName\c:\myFolder
handle /accepteula \\remotePcName\User(name of the account)\c:\myFolder
和其他一些没有运气的组合
找不到匹配的句柄。
是否有可能做到这一点?为远程电脑运行句柄?
我想在我的网络上为远程 pc 的特定文件夹运行句柄,以便知道哪些进程正在锁定文件夹。
试过:
handle /accepteula \\remotePcName\c:\myFolder
handle /accepteula \\remotePcName\User(name of the account)\c:\myFolder
和其他一些没有运气的组合
找不到匹配的句柄。
是否有可能做到这一点?为远程电脑运行句柄?
你能试试这样吗:
c:\powershell\Tools\psexec.exe \\remotePcName C:\handle.exe c:\myFolder
如何使用调用命令远程执行“句柄”?
$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