sample print monitor driver how to install programatically (by commands)

I had build DDK Sample print monitor given in WDK driver samples and it is working fine by adding manually by ADD net port type giving inf file path.
it is having files:
monitor.inf, ddklocaomon.dll ddklocakui.dll
only these files are required for installation when I use manual install.

i am searching a way to install it by Commands.

I found a way by adding registry at location
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\

but not succeded.

Is there a way to install it by Commands. ?
Note: I am searching for print monitor installation process, not a printer installation.

Port Monitor
INSTALLATION:
To install the DLL just…

  1. Copy the DLL to the System32-Directory.
  2. Add following entries to the registry:
    New key:
    “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\SamplePort”
    New value:
    “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\SamplePort\Driver” = “your.dll”
  3. Restart your Spooler-Service

this is not working for me don’t know why?