- Home /
How to close editor when using -batchmode
Hi everyone,
I'm using the following batch script to launch the editor in a second unity editor instance:
set PROJECT="C:\Unity\project_1"
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -projectPath %PROJECT% -batchmode
And now, since I can't see the Unity editor, I would like to know (if it's possible) how can I close that editor, running that project, using a batch script also? .. to avoid having to go to the Task Manager to kill the process manually.
Thanks
Answer by Helmut Duregger · Sep 14, 2012 at 02:51 PM
Take a look at the options in http://docs.unity3d.com/Documentation/Manual/CommandLineArguments.html
You can use -quit to close the Editor. With -executeMethod you can call a static method that performs whatever you need (e.g. create a standalone player build, run tests, ...).
Just look at the examples on that page.
Answer by Paulius-Liekis · Nov 26, 2015 at 10:22 AM
You can add -quit parameter for it to exit automatically. You can also call EditorApplication.Exit if you want to terminate from code.
thank you, EditorApplication.Exit was what i was looking for
Your answer
![](https://koobas.hobune.stream/wayback/20220613080741im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Windows Standalone Crashes in -batchmode , how do I read the strack from the log? 1 Answer
Prime31 azure plugin can't build 0 Answers
Unity 5 editor in Windows 64 vs 32 bit 2 Answers
Unity error 2 Answers
Unity crashing after a few minutes 3 Answers