If you are dual booting Linux and Windows, you might want to have Grub automatically select the last booted OS instead of just going with the default. The whole trick rests on adding just two lines to
Of course that has to be followed by
Now Grub will track which OS you booted last and preselect that menu entry.
PS: If you have custom menu entries, do not forget that you need to have
savedefault option present.