Are you trying to add a printer?
I am just trying to invoke a DOS command (lpr) from a C appl using the system() call.
I found that you have to enable the "LPR Port Monitor".
This via the "Control Panel/Programs and Features/Turn Windows features on or off".
I can now do
lpr -S 10.10.10.10 -P Printer test.fil
from a DOS prompt and it works.
When I try to do the same thing in an application from a system call
system("lpr -S 10.10.10.10 -P Printer test.fil");
'lpr' is not recognized as an internal or external command