I'm starting the PsExec using Powershell:

Start-Process -FilePath "psexec.exe" -ArgumentList "-u user -p pass -accepteula -i -h cmd /c `"powershell.exe -NonInteractive -File myscript.ps1`""

But the PsExec CMD is visible until the powershell script myscript.ps1 is finished.

So how can I hide PsExec CMD ?

I asked the wrong question.

Since I'm starting the PsExec using Start-Process then I can control it very easily with -windowstyle hidden as explained on the link https://stackoverflow.com/questions/1802127/how-to-run-a-powershell-script-without-displaying-a-window which was posted by @Christoper Hostage

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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