Auto-translated
I use this method:
1) Open the file in Notepad:
GAME_FOLDER/profiles/autoexec_a2.cfg
2) Add the following line to the very end:
setvar dev_console_password = schwinge-des-todes
3) Save and close the file.
4) Open the file in Notepad:
PLAYER_PROFILE_SETTINGS_FOLDER/input_a2.cfg (for me, it's c:/Users/USERNAME/Documents/My Games/Heroes of Might and Magic V - Tribes of the East/Profiles/PROFILE_NAME/input_a2.cfg)
5) After the text:
// obsolete, but strictly need for compability with some interfaces
bind close_window 'ESC'
bind confirm_action 'ENTER'
bind confirm_action 'NUM_ENTER'
Add the line:
bind show_console '`'
6) Save and close the file.
The console will be accessible in the game by pressing the tilde key (~).