command line - add new local printer port

Here you can find everything you need to know about Dll-Files. You can also share your knowledge regarding the topic.

Moderators: DllAdmin, DLLADMIN ONLY

Post Reply
keith g hicks
Posts: 5
Joined: 11 Mar 2010, 00:00

command line - add new local printer port

Post by keith g hicks »

How do I do this?

I need to set up some command line scripts to install printers for
Ghostscript. I'm tired of doing it manually on every machine. For my needs I
need a local port called "C:\Program Files\gs\output\tfile.ps" Please don't
bother me with a bunch of "why"s. It's what I need for this.

The following runs great if the port already exists.

rundll32 printui.dll,PrintUIEntry /if /f "C:\Program
Files\gs\gs8.64\lib\ghostpdf.inf" /r "c:\Program Files\gs\output\tfile.ps"
/m "Ghostscript PDF" /b "Ghostscript PS"

But if not, then it generates an error. I need to know how to add a new
local port. Can anyone help?

I also need to know how to set the new printer so it prints directly to the
printer. There's a radio button for this in the new printer wizard but no
switch for it that I can see in rundll32 printui.dll,PrintUIEntry

Thanks,

Keith

jose
Posts: 126
Joined: 17 Apr 2009, 23:00

Re: command line - add new local printer port

Post by jose »

On Mar 11, 1:56

keith g hicks
Posts: 5
Joined: 11 Mar 2010, 00:00

Re: command line - add new local printer port

Post by keith g hicks »

Doesn't seem to work. I tried several variations on that and dont' end up
with a "local port" in the ports listing. The Prnport.vbs script requires an
IP address.

http://technet.microsoft.com/en-us/libr ... 90975.aspx

Also, for anyone that might be interested in this in the future,
http://articles.techrepublic.com.com/51 ... 30819.html oddly enough
does not show all the switches for these functions. You're better off going
to http://technet.microsoft.com/en-us/libr ... 90975.aspx or one of the
other 5 related ones if you need good info on them.



"Greg Russell" <grussell@invalid.com> wrote in message
news:7vsujdF4clU1@mid.individual.net...
> "Keith G Hicks" <krh@comcast.net> wrote in message
> news:u4vLhyUwKHA.5940@TK2MSFTNGP02.phx.gbl...
>
> ...
>> For my needs I need a local port called
>> "C:\Program Files\gs\output\tfile.ps" ...
>> How do I do this? ... I need to know how to add a new
>> local port. Can anyone help?
>
> You might check to see if the standard prnport.vbs meets your needs. Its
> usage is described at
> http://articles.techrepublic.com.com/51 ... 30819.html and other
> places.
>
> Although it addresses a standard TCP/IP port, you seem clever enough to
> test
> its functionality with the file port you need.
>
>

keith g hicks
Posts: 5
Joined: 11 Mar 2010, 00:00

Re: command line - add new local printer port

Post by keith g hicks »

"Operation could not be completed. The specified port is unknown."

(and changing the printer to print directly wihtout spooling was solved with
prncnfg.vbs)

"Jose" <jose_ease@yahoo.com> wrote in message
news:b980f111-7748-460c-8d35-800fa349e1bc@a18g2000yqc.googlegroups.com...
On Mar 11, 1:56 pm, "Keith G Hicks" <k...@comcast.net> wrote:
> How do I do this?
>
> I need to set up some command line scripts to install printers for
> Ghostscript. I'm tired of doing it manually on every machine. For my needs
> I
> need a local port called "C:\Program Files\gs\output\tfile.ps" Please
> don't
> bother me with a bunch of "why"s. It's what I need for this.
>
> The following runs great if the port already exists.
>
> rundll32 printui.dll,PrintUIEntry /if /f "C:\Program
> Files\gs\gs8.64\lib\ghostpdf.inf" /r "c:\Program Files\gs\output\tfile.ps"
> /m "Ghostscript PDF" /b "Ghostscript PS"
>
> But if not, then it generates an error. I need to know how to add a new
> local port. Can anyone help?
>
> I also need to know how to set the new printer so it prints directly to
> the
> printer. There's a radio button for this in the new printer wizard but no
> switch for it that I can see in rundll32 printui.dll,PrintUIEntry
>
> Thanks,
>
> Keith

What does the error message say when it fails to work as desired?

john john - mvp
Posts: 37
Joined: 30 Apr 2009, 23:00

Re: command line - add new local printer port

Post by john john - mvp »

I think that the drivers need to be signed. Right click My Computer and
select Properties then click on the Hardware tab and then click on the
Driver Signing button and see set to "Ignore".

John


Keith G Hicks wrote:
> How do I do this?
>
> I need to set up some command line scripts to install printers for
> Ghostscript. I'm tired of doing it manually on every machine. For my needs I
> need a local port called "C:\Program Files\gs\output\tfile.ps" Please don't
> bother me with a bunch of "why"s. It's what I need for this.
>
> The following runs great if the port already exists.
>
> rundll32 printui.dll,PrintUIEntry /if /f "C:\Program
> Files\gs\gs8.64\lib\ghostpdf.inf" /r "c:\Program Files\gs\output\tfile.ps"
> /m "Ghostscript PDF" /b "Ghostscript PS"
>
> But if not, then it generates an error. I need to know how to add a new
> local port. Can anyone help?
>
> I also need to know how to set the new printer so it prints directly to the
> printer. There's a radio button for this in the new printer wizard but no
> switch for it that I can see in rundll32 printui.dll,PrintUIEntry
>
> Thanks,
>
> Keith
>
>

keith g hicks
Posts: 5
Joined: 11 Mar 2010, 00:00

Re: command line - add new local printer port

Post by keith g hicks »

That gets rid of the problem where windows gets in there and asks if it's
okay to install teh driver (which is okay by me) but it doesn't solve the
port does not exist problem.

"John John - MVP" <audetweld@nbnet.nb.ca> wrote in message
news:uFrFLvVwKHA.3764@TK2MSFTNGP04.phx.gbl...
>I think that the drivers need to be signed. Right click My Computer and
>select Properties then click on the Hardware tab and then click on the
>Driver Signing button and see set to "Ignore".
>
> John
>
>
> Keith G Hicks wrote:
>> How do I do this?
>>
>> I need to set up some command line scripts to install printers for
>> Ghostscript. I'm tired of doing it manually on every machine. For my
>> needs I need a local port called "C:\Program Files\gs\output\tfile.ps"
>> Please don't bother me with a bunch of "why"s. It's what I need for this.
>>
>> The following runs great if the port already exists.
>>
>> rundll32 printui.dll,PrintUIEntry /if /f "C:\Program
>> Files\gs\gs8.64\lib\ghostpdf.inf" /r "c:\Program
>> Files\gs\output\tfile.ps" /m "Ghostscript PDF" /b "Ghostscript PS"
>>
>> But if not, then it generates an error. I need to know how to add a new
>> local port. Can anyone help?
>>
>> I also need to know how to set the new printer so it prints directly to
>> the printer. There's a radio button for this in the new printer wizard
>> but no switch for it that I can see in rundll32 printui.dll,PrintUIEntry
>>
>> Thanks,
>>
>> Keith

keith g hicks
Posts: 5
Joined: 11 Mar 2010, 00:00

Re: command line - add new local printer port

Post by keith g hicks »

That couldn't have been much simpler! Thank you.


"John John - MVP" <audetweld@nbnot.nb.ca> wrote in message
news:%23wUHNKYwKHA.5036@TK2MSFTNGP02.phx.gbl...
> Add the port to the registry.
>
> reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" /v
> "C:\Program Files\gs\output\tfile.ps" /t reg_sz
>
> You have to restart the spooler service for changes to apply:
>
> net stop spooler
> net start spooler
>
> John
>
>
> Keith G Hicks wrote:
>> That gets rid of the problem where windows gets in there and asks if it's
>> okay to install teh driver (which is okay by me) but it doesn't solve the
>> port does not exist problem.
>>
>> "John John - MVP" <audetweld@nbnet.nb.ca> wrote in message
>> news:uFrFLvVwKHA.3764@TK2MSFTNGP04.phx.gbl...
>>> I think that the drivers need to be signed. Right click My Computer and
>>> select Properties then click on the Hardware tab and then click on the
>>> Driver Signing button and see set to "Ignore".
>>>
>>> John
>>>
>>>
>>> Keith G Hicks wrote:
>>>> How do I do this?
>>>>
>>>> I need to set up some command line scripts to install printers for
>>>> Ghostscript. I'm tired of doing it manually on every machine. For my
>>>> needs I need a local port called "C:\Program Files\gs\output\tfile.ps"
>>>> Please don't bother me with a bunch of "why"s. It's what I need for
>>>> this.
>>>>
>>>> The following runs great if the port already exists.
>>>>
>>>> rundll32 printui.dll,PrintUIEntry /if /f "C:\Program
>>>> Files\gs\gs8.64\lib\ghostpdf.inf" /r "c:\Program
>>>> Files\gs\output\tfile.ps" /m "Ghostscript PDF" /b "Ghostscript PS"
>>>>
>>>> But if not, then it generates an error. I need to know how to add a new
>>>> local port. Can anyone help?
>>>>
>>>> I also need to know how to set the new printer so it prints directly to
>>>> the printer. There's a radio button for this in the new printer wizard
>>>> but no switch for it that I can see in rundll32
>>>> printui.dll,PrintUIEntry
>>>>
>>>> Thanks,
>>>>
>>>> Keith
>>

john john - mvp
Posts: 37
Joined: 30 Apr 2009, 23:00

Re: command line - add new local printer port

Post by john john - mvp »

You're welcome.


Keith G Hicks wrote:
> That couldn't have been much simpler! Thank you.
>
>
> "John John - MVP" <audetweld@nbnot.nb.ca> wrote in message
> news:%23wUHNKYwKHA.5036@TK2MSFTNGP02.phx.gbl...
>> Add the port to the registry.
>>
>> reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" /v
>> "C:\Program Files\gs\output\tfile.ps" /t reg_sz
>>
>> You have to restart the spooler service for changes to apply:
>>
>> net stop spooler
>> net start spooler
>>
>> John
>>
>>
>> Keith G Hicks wrote:
>>> That gets rid of the problem where windows gets in there and asks if it's
>>> okay to install teh driver (which is okay by me) but it doesn't solve the
>>> port does not exist problem.
>>>
>>> "John John - MVP" <audetweld@nbnet.nb.ca> wrote in message
>>> news:uFrFLvVwKHA.3764@TK2MSFTNGP04.phx.gbl...
>>>> I think that the drivers need to be signed. Right click My Computer and
>>>> select Properties then click on the Hardware tab and then click on the
>>>> Driver Signing button and see set to "Ignore".
>>>>
>>>> John
>>>>
>>>>
>>>> Keith G Hicks wrote:
>>>>> How do I do this?
>>>>>
>>>>> I need to set up some command line scripts to install printers for
>>>>> Ghostscript. I'm tired of doing it manually on every machine. For my
>>>>> needs I need a local port called "C:\Program Files\gs\output\tfile.ps"
>>>>> Please don't bother me with a bunch of "why"s. It's what I need for
>>>>> this.
>>>>>
>>>>> The following runs great if the port already exists.
>>>>>
>>>>> rundll32 printui.dll,PrintUIEntry /if /f "C:\Program
>>>>> Files\gs\gs8.64\lib\ghostpdf.inf" /r "c:\Program
>>>>> Files\gs\output\tfile.ps" /m "Ghostscript PDF" /b "Ghostscript PS"
>>>>>
>>>>> But if not, then it generates an error. I need to know how to add a new
>>>>> local port. Can anyone help?
>>>>>
>>>>> I also need to know how to set the new printer so it prints directly to
>>>>> the printer. There's a radio button for this in the new printer wizard
>>>>> but no switch for it that I can see in rundll32
>>>>> printui.dll,PrintUIEntry
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Keith
>

Post Reply