vpncmd batch command
vpncmd can use a file with commands as an input, using the /IN:file switch.
This is the approach i would use to automate things.
Something like :
vpncmd localhost /client /in:commands.txt
Then put your command in commands.txt :
accountconnect myConnectionName
If you only want to send one command, then /IN switch could be an overkill.
In this case you could use the /CMD switch instead, something like :
vpncmd localhost /client /CMD accountconnect myConnectionName