
我正在使用 Powershell 啟動 PsExec:
Start-Process -FilePath "psexec.exe" -ArgumentList "-u user -p pass -accepteula -i -h cmd /c `"powershell.exe -NonInteractive -File myscript.ps1`""
myscript.ps1
但在 powershell 腳本完成之前,PsExec CMD 是可見的。
那麼如何隱藏 PsExec CMD 呢?
答案1
我問錯問題了。
由於我開始PsExec
使用,所以我可以按照連結上的說明Start-Process
輕鬆控制它-windowstyle hidden
https://stackoverflow.com/questions/1802127/how-to-run-a-powershell-script-without-displaying-a-window發布者:@Christoper Hostage