PsExec run remote batch file in visible mode

前端 未结 4 772
忘掉有多难
忘掉有多难 2021-01-16 12:57

I am trying to execute following command

psexec \\\\x.x.x.x -d -c -f cmd.exe /c d:\\test\\hello.bat

It runs fine and gives output



        
4条回答
  •  悲哀的现实
    2021-01-16 13:26

    Alex K. is correct. Specifically, remove the "-d", which tells PsExec "Don't wait for process to terminate (non-interactive)". In fact, if you run the sample batch file above, which includes "pause", the cmd process will continue to run on the remote host (invisible to the remote host's GUI, since it's done via PSExec) until you kill that process.

提交回复
热议问题