2

Why does the psexec-executed command below fail when I add double quotes to the parameter?

  • It works fine without psexec with double quotes
  • It works fine with psexec without double quotes!

enter image description here

The contents of the .bat file are as follows:

set FILEPATH=%~1
set BAT_ARCHIVE_IDENTIFIER=%~2
set DEPLOYMENT_ROOT=%~3
echo %FILEPATH% %BAT_ARCHIVE_IDENTIFIER% %DEPLOYMENT_ROOT%
Allan Bowe
  • 12,306
  • 19
  • 75
  • 124
  • The third execution was just a demo. The point is that the first two give different results depending on whether the parameter is quoted (see blue arrows). Still - it IS the same batch! – Allan Bowe Jul 23 '14 at 11:15
  • 2
    Sorry, you are right. I was reading where i shouldn't. – MC ND Jul 23 '14 at 11:33

1 Answers1

5
psexec -u user -p pass cmd /c "d:\GitRepos\runAll.bat a1 a2 "a3""
MC ND
  • 69,615
  • 8
  • 84
  • 126