Are you asking how to specify which scenes are used when making a build through the command line? If so, here's how I would go about it.
For your first question,
How to specify SceneName ?
I am unaware if you can directly specify scene names in the command line, but you can run specific functions using the command line that can change which scenes are built for the project.
Here is a snippet you would need but can change for your use case
using UnityEditor;
class MyEditorScript
{
static void PerformBuild ()
{
string[] scenes = { "Assets/MyScene.unity" };
BuildPipeline.BuildPlayer(scenes, ...);
}
}
The above snippet is quite simple, you specify each scene directly then add it to your build settings. You can pass in parameters to get different results or make multiple functions, whichever is easiest for you. Here is how you would call this function in the command line
"C:\Program Files\Unity\Editor\Unity.exe" -batchmode -executeMethod MyEditorScript.PerformBuild
I use -batchmode here so if any prompts are brought up, Unity will silence them so the process can be much more automated.
As for your second question,
And how to specify destination directory ?
I am not sure if you want to tie the directory where you save and the scenes you build with, but it might make everything easier. There is a build setting called BuildPlayerOptions.locationPathName, which allows you to specify where the build is save
static void WebGLProductionBuild()
{
// Build the player.\
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
buildPlayerOptions.scenes = new[] { "Assets/Scene1.unity", "Assets/Scene2.unity" };
buildPlayerOptions.locationPathName = "yourLocationNameHere";
buildPlayerOptions.target = BuildTarget.WebGL;
buildPlayerOptions.options = BuildOptions.None; // set whatever you want here
BuildPipeline.BuildPlayer(buildPlayerOptions); // apply the setting changes
}
To call the above method is exactly the same except for the function call as the above line
"C:\Program Files\Unity\Editor\Unity.exe" -batchmode -executeMethod MyEditorScript.WebGLProductionBuild
I do not believe what you want to achieve can completely be done from command line, but this answer is pretty close. I am also not exactly sure if you wanted the scenes and the new path bundled together. If you are looking to build each individual scene and specify a new path, you can do so by making a new function with a switch statement or just make multiple functions to call.