HOWTO: Tell Grub to load windows 7 as default (debian)

… is quite easy if you know what to do (and it’s update safe!):

Will be / Is DEPRECATED. Please refer to:

Only precondition: win7 or any other OS you want to boot as default is the next OS after the standard debian entries in the grub list / win7 is the only other OS installed

1. Edit /etc/default/grub

#find&edit or add if it doesn't exist
GRUB_DEFAULT=`/bin/bash "/somedir/"`

2. in /somedir/ create a with the following content


VAR1=`ls -l /boot | grep -v .bak | grep -c initrd.img`
VAR2=`ls -l /boot | grep -v .bak | grep -c vmlinuz`


3. make it executable

chmod 777

4. update-grub

sudo update-grub

(I have not tested it on ubuntu, but it should work there too)