setupc.exe — the Setup Command Prompt — is com0com’s command-line configuration tool, installed together with the driver. It does everything the graphical SetupG does, from a console: create and remove pairs, rename ports, switch emulation options, and list the current configuration. That makes it the right tool for scripting a repeatable setup, working over a remote session, or fixing a configuration on a machine where the GUI is inconvenient. This is the complete reference for the commands the official documentation describes.
Getting a setupc prompt
setupc lives in the com0com installation folder, and the package installs a “Setup Command Prompt” shortcut that opens it there, ready to use. Run it as administrator: creating and changing driver ports is a privileged operation, and a non-elevated prompt will fail. At the interactive prompt you type commands after the command> cursor. setupc also accepts a command directly as its arguments — setupc install - - from an ordinary elevated console does the same thing — which is exactly what makes batch-file scripting possible (last section).
Forgotten a command’s shape? The built-in help is the authoritative syntax reference for your exact build — worth consulting even if you know the commands, because it lists every setting a change command accepts on this installation, including ones this reference does not dwell on:
command> help
install — create a pair
command> install - -
This creates one virtual port pair with the next free default names. Each - placeholder means “assign the default name for this end”, so on a fresh system the result is CNCA0 and CNCB0; on a system that already has a pair, CNCA1 and CNCB1. The command reports the names it created. A newly installed system already has the first pair from setup, so you will use install mainly for second and subsequent pairs — or to recreate a pair you removed. There is no practical count limit: the official FAQ gives an internal ceiling of 1,000,000 pairs.
change — rename ports and set options
change modifies one existing port. Its form is change <port> <setting>=<value>, and it backs every per-port option you can set in SetupG.
Rename a port to a standard COM name (which also places it in the Windows Ports class, so applications can discover it):
command> change CNCA0 PortName=COM8
Enable baud rate emulation on a port, so data sent from it is paced at the baud rate the application selected instead of arriving instantly (off by default):
command> change CNCA0 EmuBR=yes
Enable receive buffer overrun emulation on the receiving port, so it can drop data like real hardware when the reader is too slow — the ReadMe’s FAQ also recommends this setting for the receiving end when data appears to hang in a pair:
command> change CNCB0 EmuOverrun=yes
Noise emulation randomly corrupts data with a chosen probability, for protocol robustness testing:
command> change CNCA0 EmuNoise=<probability>
To undo an emulation option, set it back to no (for example change CNCA0 EmuBR=no). Close any application that has the port open before changing it; an open port keeps the configuration it started with. The reasoning behind each option is explained in the SetupG guide and the renaming guide.
list — show the current configuration
command> list
list prints every pair and port the driver currently has, with their names and settings. Run it after every install or change to verify the result is what you intended — it is the console equivalent of eyeballing the pair list in SetupG, and the fastest way to answer “what is this machine actually configured with?” on a system someone else set up.
remove — delete a pair
command> remove CNCA0 CNCB0
remove deletes a pair, naming both of its ports. Both ends go together — you cannot remove half a pair, because a pair is a single cross-connected object. Make sure no application has either port open first; an open handle can block the removal. After removing, list confirms the pair is gone, and the port names (including any COM numbers you had assigned) are free to reuse.
update — refresh the ports after a driver change
command> update
update re-applies the current configuration to the driver — the command to reach for after reinstalling or updating the driver itself, when existing pairs need to be re-registered against it. In day-to-day use you will rarely need it; install and change already commit their work. If pairs are missing entirely and update brings nothing back, suspect the driver rather than the configuration: check Device Manager for a Code 52 signature rejection (see the installation guide).
When a command does not do what you expected
- Access is denied / the command fails instantly. The prompt is not elevated. Close it and reopen the Setup Command Prompt as administrator — driver configuration cannot be changed from a standard-user console, and setupc will not always spell that out.
- “Port not found” style errors on
changeorremove. The name you typed is not the name the driver knows. Runlistand copy the exact name — a port you renamed to COM8 is changed by its current identity, and a pair’s second end is CNCBn, not a second CNCA. - A
changeseems to be ignored. An application has the port open and is holding the old configuration. Close every program connected to either end of the pair, then repeat the change and verify withlist. installcreated different names than your script assumed. Default numbering continues from the pairs already present. On a machine with one existing pair, your new pair is CNCA1/CNCB1, not CNCA0/CNCB0 — read the names from theinstalloutput instead of assuming them.- Nothing exists to change at all. If
listshows no pairs on a fresh install, the driver itself likely failed to load. That is not a setupc problem — check Device Manager for Code 52 and work through the installation guide.
Scripting a pair in a batch file
Because setupc accepts commands as arguments, a complete, repeatable pair setup is a four-line batch file. Run it elevated, from (or pointing at) the com0com installation folder:
@echo off
setupc install - -
setupc change CNCA0 PortName=COM10
setupc change CNCB0 PortName=COM11
setupc list
That creates a fresh pair and immediately renames it to COM10/COM11, then prints the resulting configuration so your log shows exactly what was built on that machine. Two scripting cautions: the default names in the change lines assume the pair you just created received the CNCA0/CNCB0 names — on a machine that already has pairs, the new pair gets the next numbers, so read them from the install output or an initial list and adjust. And keep the script’s port numbers consistent with your machines’ physical hardware, so a scripted COM10 never collides with a real adapter that happens to be plugged in that day.
From here, put the pair to work: the first-pair walkthrough ends with a loopback test you can run against your scripted ports to prove the whole chain. Remaining questions — what the emulation options are for, why a port does not appear in an application — are answered in the FAQ and across the Guides archive.
