I just connected using
"\program files\ultravnc\vncviewer.exe" -password PASSWORD SERVERNAME
I connect to a local VNC server using this method in a batch file.
While I think that trying to do this at start up offers a set of potential problems which need to be addressed, it is nevertheless possible. As noted there needs to be enough time for the network to initialize, then you need to consider that the server may not even be on for whatever reason. I find it easier to just double click a shortcut to the batch file when I'm ready, however I have tested the following on a couple of computers and it does indeed work.
Create a batch file that will start the viewer, but put a timed pause in the batch file that gives the network time to initialize. My preference is sleep, but I have seen ping used for the same purpose. In my computer 60 seconds was more than enough, but your mileage may vary
Create a shortcut to the batch file in the startup folder.
In the shortcut properties set Run > Minimized
This won't work if the VNC server is across a network connection and you run it from the Startup folder. As user69026 said, the network drivers won't be loaded fully yet and any IP connection or drive mapping won't be available. – Ken White – 2011-02-24T19:17:41.843
1That's why he mentioned a delay of 60sec. I've done that and works great, although you might want to tweak the wait period. – TheNewbie – 2011-02-25T20:22:21.623