You need to call psql at the prompt otherwise a black screen will pop up and disappear.
In order not to enter this long path, create an environment variable in windows and add the executable path so psql will be available at the prompt without needing to be in the postgres folder.
1 - Right click on (my) computer > properties > advanced settings
2 - In the advanced tab click environment variables, in the variáveis do sistema
click new tab.
3-clickonnovo
ofthenameofpg_home
andpassthepathofthebinfolderofpostgres.
4-Stillonthevariáveisdosistema
tab,searchforpath
clickoneditplacethecursorattheendandtype:;%pg_home%
.Thepointandvirgularisthepathseparatorinwindows.5-Openanewpromptandtypepsql
shouldwork.
At the prompt type:
psql -U usuario -d database
Then enter the user's password and enter the queries you need.
Documentation with psql parameters