Starting sketch before connection to pc

Depends on what you have. This link shows you haw for some versions:-
http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection

On the uno it is a pad to the left of the resistor pack marked reset close to pin 14 of the ATmega chip, slice the thin wire in between and add a solder blob to reconnect.