powershell 關閉遠端開啟的檔案

laremehpe發表於2024-03-08
$results=net file
foreach ($result in $results) {
    $id = $result.Split(" ")[0]
    net file $id /close
}

配合ssh:

start /b ssh administrator@192.168.2.112 "C:/Users/Administrator/Desktop/disconnect.ps1"

相關文章