# How to view the system console message after Blender crashes?

I am testing a script in Blender game engine. I can view the helpful message on the external system console when the script throws exception. Sometimes the bugs of the script cause the Blender to crash and close the console immediately.

Is there any way to view the message after the Blender crashes? How to write the message to a text file for later viewing? Any suggestion?

• On windows just run blender from Command Prompt:

Win Key+R

In field type cmd and hit OK. Inside the console navigate to your blender.exe with command

cd c:\Program Files\Blender Foundation\Blender\ (or whatever your path is)
instead you can also navigate to the folder in the Explorer and SHIFT+Rightclick on the Folder and select Open Comand Promt here

and then type blender.exe

You can also use command line arguments.

Now even if Blender crashes, you will still see the program output in the console.

• On OSX use Terminal app and run it like

cd /Applications/Blender
./blender.app/Contents/MacOS/blender

• On Linux open terminal and run

cd <blender installation directory>
./blender


You can start blender (or blender.exe) with the option --factory-startup attached to check if a addon or a setting caused the crash

• thanks for the suggestion, it worked cd "c:\Program Files\Blender Foundation\Blender"<br> blender<br> – ShungChing Jan 5 '15 at 18:23
• On vista and windows 7 you do not have to open the run window. You can type cmd in to the start menu and press enter. – David Jan 6 '15 at 17:16

Start blender from a console / cmd prompt in the first place and if it crashes, it will just return to the console and not close the console.

For windows i set up a bat file to load cmd.exe, with any of these variants:

start C:\Windows\System32\cmd.exe /k C:\blender_trunk\blender.exe --debug-all

start C:\Windows\System32\cmd.exe /k C:\blender_trunk\blender.exe --debug

start C:\Windows\System32\cmd.exe /k C:\blender_trunk\blender.exe

It will load the cmd prompt, then blender, and depending on how much info you want you add the debug flag. Make a shortcut to the bat file, and all you have to do is click it to start Blender + console

• thanks for the suggestion, i tried and found that the quote should be as follows: start C:\Windows\System32\cmd.exe /k "c:\Program Files\Blender Foundation\Blender\blender.exe" --debug-all<br> it was a minor typo that may confuse others who may want to try your suggestion. – ShungChing Jan 5 '15 at 18:21
• @ShungChing the quote in my post is exactly how I have it on my system, but it appears the quotes can be dropped entirely. – zeffii Jan 6 '15 at 11:57
• If there is a space in the path, it must be wrapped in quotes. – Greg Zaal Jan 7 '15 at 5:22
• yes, that's what I thought! my original path doesn't have spaces so the quotes aren't even needed, whereas @ShungChing's path is program<space>files – zeffii Jan 7 '15 at 12:11

Go to the Menu Bar > Windows and click on Toggle System Console

• Please note the Toggle System Console menu item exists only for Microsoft Windows OS builds of blender. – batFINGER Mar 25 at 1:12