slloyd has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to find a way to
1 - add a "local port" with a name like "c:/temp/abc.ps" 2 - assign a printer to this newly created port 3 - remove the "local port" created above
So far I cannot find a way to add a "local port". I can add a tcp port using prnport command in system32 but it will now allow me to add a local port. I can also assign a printer to a port as follows:
C:\WINDOWS\system32>cscript prncnfg.vbs -t -p "HP 2500C Series PS3" -r + "c:/temp/abc.ps"
So I just have to figure out a way to script adding a local port. Any suggestions?
s/te/ve/

Replies are listed 'Best First'.
Re: add a local port on windows
by ikegami (Patriarch) on Mar 05, 2010 at 00:53 UTC
    So you're asking for help converting prncnfg.vbs to Perl? What part if giving you a problem?
      prncnfg does not allow you to add a "local port" nor does any of the prn*.vbs family that M$ offers in system32. At least not that I can find. What I am asking is - is there a Perl way to add a "local port"?
      s/te/ve/

        I very confused. In the OP, I understood that you could do it using prncnfg.vbs. Now you say you can't.

        If you can't, there's no much I personally can do. You'll need to find out how to do what you want to do at the system level. Once you do, we can help you implement it in Perl.

        is there a Perl way to add a "local port"?

        If Windows can do it, Perl can do it.

        There is only win32 ways, in perl you just do what you would do with win32 calls normally
Re: add a local port on windows
by cdarke (Prior) on Mar 05, 2010 at 07:07 UTC
    Any suggestions? Ask Microsoft.