PC Review


Reply
Thread Tools Rate Thread

command line - add new local printer port

 
 
Keith G Hicks
Guest
Posts: n/a
 
      11th Mar 2010
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


 
Reply With Quote
 
 
 
 
Greg Russell
Guest
Posts: n/a
 
      11th Mar 2010
"Keith G Hicks" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

....
> 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...1-5030819.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.


 
Reply With Quote
 
Jose
Guest
Posts: n/a
 
      11th Mar 2010
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?
 
Reply With Quote
 
Keith G Hicks
Guest
Posts: n/a
 
      11th Mar 2010
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/l.../bb490975.aspx

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



"Greg Russell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Keith G Hicks" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> ...
>> 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...1-5030819.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.
>
>



 
Reply With Quote
 
Keith G Hicks
Guest
Posts: n/a
 
      11th Mar 2010
"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" <(E-Mail Removed)> wrote in message
news:b980f111-7748-460c-8d35-(E-Mail Removed)...
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?


 
Reply With Quote
 
John John - MVP
Guest
Posts: n/a
 
      11th Mar 2010
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
>
>

 
Reply With Quote
 
Greg Russell
Guest
Posts: n/a
 
      11th Mar 2010
"Keith G Hicks" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> Also, for anyone that might be interested in this in the future,
> http://articles.techrepublic.com.com...1-5030819.html oddly

enough
> does not show all the switches for these functions.


.... as clearly (?) stated in the article, along with instructions for
finding the XP system help that shows all possible switches for the "new
command tools".

It's unfortunate that it insists on a TCP/IP port, as a printer "port"
should be any abstract that fits the need. That limitation is consistent
with M$'s general failings however.

Glad the prncnfg.vbs worked for part of the issue you're dealing with,
though.


 
Reply With Quote
 
Keith G Hicks
Guest
Posts: n/a
 
      11th Mar 2010

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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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



 
Reply With Quote
 
John John - MVP
Guest
Posts: n/a
 
      12th Mar 2010
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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

>
>

 
Reply With Quote
 
Keith G Hicks
Guest
Posts: n/a
 
      12th Mar 2010
That couldn't have been much simpler! Thank you.


"John John - MVP" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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

>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding printer/port through command line automatically =?Utf-8?B?QXJjaGkz?= Windows XP Print / Fax 1 9th Jul 2007 10:25 PM
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 1 29th Apr 2006 02:05 AM
USB001 Virtual printer port vs USB002 Local port vs USB003 Virtual printer port ???? BobLeavitt Windows XP Print / Fax 1 26th Sep 2004 05:12 AM
Adding/Deleting a local printer via the command line. =?Utf-8?B?SVROQVRF?= Microsoft Windows 2000 Printing 1 8th Jan 2004 01:59 AM
Re: Adding a TCP/IP port and printer via the command line (batch file) Walter Schulz Microsoft Windows 2000 Printing 0 14th Nov 2003 05:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:52 PM.