If you don't want to keep your password in plain text in registry (may be accessed by everyone even via network in domain environment) look at LogonExpert autologon tool. It keeps your credentials AES 256bit encrypted. It also supports the command line\script control