Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

capture printer port? 2

Status
Not open for further replies.

G0ldeneye

IS-IT--Management
Dec 9, 2003
74
US
Can anyone explain, in detail if needed, what the capture printer port feature/option is in win98? I have an idea, but not fully clear on it.

I have a cpu sharing a laser printer, and the two cpus accessing the shared printer keep getting an error message when they try and print. Something about user intervention required. Then, as soon as I uncheck "Use Printer Offline", all their jobs that never printed suddenly start printing. I think I fixed this by choosing the capture port option on the cpus that are using the shared printer. I selected LPT1 and for the location I put in the network path (\\hompc28\322) and clicked "Reconnect at logon". Although this worked I think, I still don't fully understand what's happening. Can anyone explain please? Thank you.
 
Capturing a printer port essentially means giving it an address so data can be sent to it.
When you have it hooked up to your PC, your OS identifies (i.e. addressed) it by the port it is connected to. This is fine for the computer that is connected to it, but if you are on a network, other computers will only see the PC (or at least its IP address), not anything connected to it, and need to have an address to be able to talk to the printer.
 
I find the capture printer port option somewhat flaky, it works sometimes but then loses its way
It is used to divert print data sent by your local PC to its LPT port to a shared network printer and only applies to Win98 workstations, It will not work with Windows 2000 or XP
Try the Net use command, this will work with all Versions of windows, the synthax is;
NET USE LPT1:\\servername\printersharename

to undo the command;
NET USE LPT1: delete

Try it at the command prompt to get the synthax right, then put it in a batch file or logon script
 
I've never used the NET USE command. When I put it NET USE LPT1:\\hompc28\322, is that turning something on? Will I have to do that everytime I start that cpu? Also, I've never made a batch file or logon script. Can you explain... please!? Thanks for your time fitfixer.
 
A port captured using the "net use" command normally only lasts as long as the PC is powered up. You add add the following switch to the end of your net use line to make it permanent.

/persistent:yes

 
CRISC is quite correct, net use is discarded at shutdown so the command has to be run at

each startup, you can use the persistent:yes switch to make it permanent,but make sure you

have it right before you add this to the command,

We use net use quite a lot on our network, our Sun Database insists on printing to LPT2 so I

put a batch file in the logon script of each Sun user so the the command is run at startup;

NET USE LPT2:\\proliant800\epson103

note the spaces, these are needed to make it work, the command is not case sensitive,

I would suggest that you make a batch file, open notepad and type in the command as above,

using your own \\servername\printersharename (I keep the sharename down to 8 characters)
then save as.. name it something like print.bat, or anything with a .bat extension
in the "save as" box where it says "Save as type" choose "all files" otherwise your file

will be called print.bat.txt which will not work
Save it to the desktop, or put a shortcut on your desktop, double-click to run the command.

If it does not work first time, just r-click on the icon and select "edit" check the

spelling and spaces. make sure the slashes are \\ and not //
The command will report if it is successful

Log-on scripts are used by Admins to run batch files at startup, you would need to read up
on this, try searching in Google,

You could use the persistent switch, or just run it manually each day
or you could put the print.bat in the startup group

Hope this helps

F.Farrell
sysadmin
f.farrell@codubvec.ie
 
In order to use NET USE LPT1 \\hompc28\322, do I have to end the currently captured port? The reason I ask is becuase I get this error when I run the .bat file I created:
________________________________________________

C:\Windows >NET USE LPT1 \\HOMPC28\322
LPT1 is currently \\hompc28\322
The local device name LPT1 is already in use.
Do you want to continue? (Y/N)
________________________________________________

Also, it didn't work with a semicolon after LPT1 so I left that out.
 
If you get this message then that port was already in use. Hitting Y (for yes) will remap it as you entered. You can also just type "net use" to get a display of what all your ports are currently mapped to.


"Also, it didn't work with a semicolon after LPT1 so I left that out."

As fitfixer provided, the syntax is:

NET USE LPT1:\\servername\printersharename

Note that after LPT1 its a colon ":" not a semicolon ";" You don't have to use the colon, however
 
I created a .bat file with this...

net use LPT1 \\hompc28\322 persistent:yes

...and put a shortcut of it in the startup folder. Is there a way to make the batch window close automatically when it is opened on startup?

thx
 
It will go away by itself, it's not closing now because the syntax is incorrect. The "persistant:yes" should have a "/" in front of it (since its a switch).

Actually, if you're putting this batch file in your startup folder, you can remove the /persistant:yes switch entirely, as this will run (and recapture LPT1) each time you boot.
 
In the command: net use LPT1 \\hompc28\322 persistent:yes, where do I put the /? If I put it right before the p in persistent, like this: /persisten:yes, I get an error saying "The option "PERSISTENT:YES" is unknown. Make sure your are specifying a valid option, and then try again." Should there be a space between the / and the p?

Also, if I DON'T use the /persistent:yes switch and put it in the startup folder, it does not close automatically. If I don't put it in the startup folder, how do I get it to run at startup?... would I just make the batch file with the /persistent:yes switch and open it once and it will be set for good? Thanks.
 
In your example, you should type:

net use LPT1 \\hompc28\322 /persistent:yes

If you do this, you should get a message saying "The command completed successfully".
I recall from a prior post that you said you were getting a message saying LPT1 was already in use, if you get this then, as I said, hit the Y button.
If you get something else, then post back in this thread with what it DOES say.
You don't have to do anything else. This capture will stay until you end it.

If you choose to go about this using a batch file in your startup, then this is what should be in it:

net use LPT1 \\hompc28\322

If you have this in your batch file, and is not closing, might I inquire as to what OS you are using?
 
Thanks for the timely response crisc!! I'll try the net use LPT1 \\hompc28\322 /persistent:yes command and see what happens. I'm using windows 98.
 
I use the net use command to print to a network printer from a dos program that will generally only print to an LPT port.
I have never used the /persistent:yes switch and it always works after a shutdown.

How come?

Running XP pro.
 
I'm having a couple of problems,

The computers that are connecting to the shared printer are 98 machines, as well as the cpu sharing the printer.

malaycobra, do you put the batch file in the startup folder?

When the computers accessing the shared printer starts up, the script runs and it says "successfully connected to \\hompc28\322" and the cmd window doesn't close... how can I get it to close?

Then I come back a little later and run the "net use" command because the user says their printer isn't working, and it says "Status: Disconnected". Then I re-run the batch file and it says "LPT1 is currently \\hompc28\322, The local device name LPT1 is already in use. Do you want to continue? (Y/N)"

Do you know how to fix any of these annoying and persistent problems?...Anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top