diff --git a/bin/spark-class.cmd b/bin/spark-class.cmd index 3bf3d20cb57b5..6a25838ab531f 100644 --- a/bin/spark-class.cmd +++ b/bin/spark-class.cmd @@ -20,4 +20,9 @@ rem rem This is the entry point for running a Spark class. To avoid polluting rem the environment, it just launches a new cmd to do the real work. -cmd /V /E /C "%~dp0spark-class2.cmd" %* +echo "%~dp0spark-class2.cmd"|findstr /C:" " +if %ERRORLEVEL% EQU 0 ( + cmd /V /E /C "%~dp0spark-class2.cmd" %* +) else ( + cmd /V /E /C %~dp0spark-class2.cmd %* +) diff --git a/bin/spark-shell.cmd b/bin/spark-shell.cmd index 991423da6ab99..47de25fb143e4 100644 --- a/bin/spark-shell.cmd +++ b/bin/spark-shell.cmd @@ -20,4 +20,9 @@ rem rem This is the entry point for running Spark shell. To avoid polluting the rem environment, it just launches a new cmd to do the real work. -cmd /V /E /C "%~dp0spark-shell2.cmd" %* +echo "%~dp0spark-shell2.cmd"|findstr /C:" " +if %ERRORLEVEL% EQU 0 ( + cmd /V /E /C "%~dp0spark-shell2.cmd" %* +) else ( + cmd /V /E /C %~dp0spark-shell2.cmd %* +) diff --git a/bin/spark-submit.cmd b/bin/spark-submit.cmd index f301606933a95..a50692191dd98 100644 --- a/bin/spark-submit.cmd +++ b/bin/spark-submit.cmd @@ -20,4 +20,9 @@ rem rem This is the entry point for running Spark submit. To avoid polluting the rem environment, it just launches a new cmd to do the real work. -cmd /V /E /C "%~dp0spark-submit2.cmd" %* +echo "%~dp0spark-submit2.cmd"|findstr /C:" " +if %ERRORLEVEL% EQU 0 ( + cmd /V /E /C "%~dp0spark-submit2.cmd" %* +) else ( + cmd /V /E /C %~dp0spark-submit2.cmd %* +)