Yes, you can do this via the IBController program. This program is essentially an old MS-DOS .bat file which let's you set the parameters for opening IB, including setting the userID and password in the .bat file. However, it does not get you through the security validation with the security card. You have to disable that feature in TWS if you want a true automatic login, though of course this decreases security.
The IB Controller also lets you set parameters to get around the daily auto-logoff, by continuously pushing out the auto-logoff time so you don't have to worry about it. However, this can result in TWS instability, so you should still log off periodically.