you want the /server command
/server [-mnsarpfoc] <server/groupname> [port] [password] [-i nick anick email name] [-jn #channel pass]
Connects you to a server, first disconnecting you from the current server.
/server irc.undernet.org 6667 mypassword
If you type /server with no parameters, mIRC will connect to the last server you used. If you use the server command while still connected, you will be disconnected with your normal quit message and will then connect to the specified server.
You can also use /server N which connects to the Nth server in the server list in the connect dialog.
You can also use /server groupname which will cycle through all the servers in the server list which have that group name until it connects to one of them.
The -m switch creates a new server window for that connection and connects to the server. The -n switch does the same thing but does not connect to the server.
The -pfoc switches prevent perform, popup favorites folder, autojoin channels, and the on connect event when you connect to a server.
If you specify any of the -sar switches, the format of the command becomes:
/server -sar [server] [-p port] [-g group] [-w password] [-d description]
-s sorts the servers list
-a adds a server. If it exists, it is updated
-r removes a server
mIRC tries to find a match for either the server address or the description in the existing servers list. You can also specify none for -g -w and -d to clear the current setting.
Specifically, you want to use:
/server -a server.address.url -p port#'s -g groupname -d description which may include spaces
example to add group IRCchat (made up name/info), irc.chat.org, ports 6667-6669, description IRC Chat Network you would use this:
/server -a irc.chat.org -p 6667-6669 -g IRCchat -d IRC Chat Network
Hope this helps.