
For an arbitrary browser you can't. It is a security risk, theoretically. JS only supports a single print function and that always pops up the print dialog so the user has control over whether something is printed or not. This is necessary because only the user knows which printer/settings to use (in many cases) and it prevents a webpage from spamming the printer which some places charge money to use (such as for grants).
Having said that if you have a controlled environment then there are some things that you may be able to do. Firstly ensure that Windows has a default printer configured. Some browsers allow silent printing with a command line flag as discussed here.