Windows – PsExec will copy the .exe but won’t let me pass arguments to it

deploymentpstoolswindows

This command copies the program test.exe to the remote system and executes it interactively:

psexec \\marklap -c test.exe

However I need to pass some arguments to the text.exe program.

This doesn't work:

psexec \\marklap -c "test.exe /S"

Best Answer

I figured it out. You need to quote the .exe part and then just put the arguments for it after it:

psexec \\marklap -c "test.exe" /S