That is a matter of Windows/batch, it is not specific to SQL*Plus.
You can do this:
(echo connect firstname.lastname@example.org/min19_o71
echo select * from dual;
) | sqlplus -S /nolog
C:\Users\balaz>(echo connect email@example.com/min19_o71
More? echo select * from dual;
More? echo exit
More? ) | sqlplus -S /nolog
I'm not sure what I did, but I have the service running now. I guess it is a combination of little of everything
Open CMD as administrator
browse to pgagent.exe
cd C:\Program Files\PostgreSQL\pgAgent\bin
Remove the pgAgent service (if pgAgent service is installed, but does not work)
pgAgent REMOVE pgAgent
Then I installed the service again.