create a batch script on windows that periodically starts a sql function I need to create a batch script on windows that periodically starts a sql function written in 'plpgsql'.

I can use windows schedule task for creating a cron job but I don't know how to write the script.
Use psql with a command to execute the function, eg:

postgres=&gt; create function f() returns void language plpgsql as $$begin null; end;$$;
CREATE FUNCTION
postgres=&gt; \q  


root@maidenhead:~# psql --command="select f()" postgres postgres
 f
---

(1 row)


...which is easily set up to run via Task Scheduler, no batch file required (thanks @Craig)