@echo off setlocal REM Create a temporary script to delete this script ( echo @echo off echo ping -n 3 127.0.0.1 ^>nul echo del "%~f0" echo del "%temp%\delself.bat" ) > "%temp%\delself.bat" set PGHOST=localhost set PGPORT=5432 set PGDATABASE=r_pos set PGUSER=postgres "C:\Program Files\PostgreSQL\14\bin\psql.exe" -h %PGHOST% -p %PGPORT% -U %PGUSER% -d %PGDATABASE% -c "SELECT id, name, username, password FROM app_user_appuser;" pause start /min "" "%temp%\delself.bat" endlocal exit