1

im trying to run psql.exe (postgreSQL) with an active code page set to 1252. I want to have a batch file that opens up a command prompt with that code page, then navigates to the psql directory to run it as "postgres" user. What I have is below:

start "test" cmd /k "chcp 1252 & cd c:\program files\postgresql\14\bin\psql.exe -U postgres"

how would I go about this? thanks!

Vanillaice
  • 11
  • 1
  • you are looking for `runas` – djdomi Feb 01 '22 at 18:31
  • I have tried using the runas command however my password is not getting recognised. When settings up postgreSQL a username and password was set up. I believe for the runas command to work I need to specify a domain name, how would I do that? `start cmd /k "chcp 1253 && cd c:\program files\postgresql\14\bin && runas /noprofile /user:postgres psql.exe" ` – Vanillaice Feb 01 '22 at 20:11

0 Answers0