PSExec Command to execute multiple cmd

@RealStruggler 21 Reputation points
2021-03-15T11:36:41.197+00:00

Hello Guys,

I am having a bit of challenge executing two cmds using psexec.

Here's my command

77785-host.png

But the same doesn't work with psexec

77780-ps.png

I have also tried the command below:

PSExec \Machinename cmd /c (hostname ^& bcdedit | find "path")

doesn't work.

Any suggestions please =)

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-03-15T12:05:42.733+00:00

    Hi @@RealStruggler ,

    Try replacing parentheses with quotation marks

    PsExec \\Machinename cmd /c 'hostname && bcdedit |find "path"'  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.