There is lots of stuff on this topic, each slightly different. Like many users I spent hours trying them ...
stackoverflow.com