查看是否有名为 C:\Users\zhangcl\Desktop\tooling 的文件夹被打开
$tooling = $false
(New-Object -ComObject 'Shell.Application').Windows() | ForEach-Object {
$localPath = $_.Document.Folder.Self.Path
if($localPath -eq "C:\Users\zhangcl\Desktop\tooling"){
$tooling = $true
}
}
$tooling
网友评论