Yml config files in a different directory

I am trying to set the yml config files in my directory in Windows.

I tried
es.config is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed

I tried
Unrecognized option, Error Could not create the Java Virtual Machine

What is the proper syntax to do it please?

-Des.path.conf should work

Thank you. It worked.
Is it the same for Kibana and Logstash?

I don't think so