Well, if you feel at home with Studio use that.
If you like avrdude, you could do it like this:
avrdude -c <programmer> -p <mcu> -B 100 -P <port> -b <baudrate> -e -U lock:w:0x3F:m -U lfuse:w:0x<lfuse>:m -U hfuse:w:0x<hfuse>:m -U efuse:w:0x<efuse>:m
avrdude -c <programmer> -p <mcu> -B 1 -P <port> -b <baudrate> -U flash:w:<hexfile>:i -U lock:w:0x0F:m