Skip to content

Commit 515b644

Browse files
Mpdreamzjasontedor
authored andcommitted
Fix starting on Windows from another drive (#29086)
The cd command on Windows has an oddity regarding changing directories. If the drive of the current directory is a different drive than than of the directory that was passed to the cd command, cd acts in query mode and does not change the current directory. Instead, a flag is needed to put the cd command into set mode so that the directory actually changes. This causes a problem when starting Elasticsearch from a directory different than the one where it is installed and this commit fixes the issue.
1 parent 3120049 commit 515b644

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

distribution/src/bin/elasticsearch.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" (
5050
exit /b 1
5151
)
5252

53-
cd "%ES_HOME%"
53+
cd /d "%ES_HOME%"
5454
%JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!
5555

5656
endlocal

0 commit comments

Comments
 (0)