Problems printing with DOS program using "net use lpt1"
Moderator: DosItHelp
-
- Posts: 3
- Joined: 21 Jan 2015 22:12
Problems printing with DOS program using "net use lpt1"
I have a program called Books that runs in DOS on my windows XP system. It prints from my network printer instead of my USB printer. I tried the "Net use lpt1...." thing and it tells me "local device name already in use" and error 85and still prints to the network printer
So the bat file is where I put the net use lpt1. I actually changed "Gina" which is the computer name to the name the computer uses on the network, forgot to take a new pic. And "printer" is the shared name for the printer. Any idea on how to fix this?
Also, what does all the other stuff mean below the "net use" line?
https://imgur.com/a/IScom
So the bat file is where I put the net use lpt1. I actually changed "Gina" which is the computer name to the name the computer uses on the network, forgot to take a new pic. And "printer" is the shared name for the printer. Any idea on how to fix this?
Also, what does all the other stuff mean below the "net use" line?
https://imgur.com/a/IScom
Re: Problems printing with DOS program using "net use lpt1"
needbatchhelp wrote:I have a program called Books that runs in DOS on my windows XP system. It prints from my network printer instead of my USB printer. I tried the "Net use lpt1...." thing and it tells me "local device name already in use" and error 85and still prints to the network printer
"local device name already in use" indicates that there is already a LPT1 it looks like.
So the bat file is where I put the net use lpt1. I actually changed "Gina" which is the computer name to the name the computer uses on the network, forgot to take a new pic. And "printer" is the shared name for the printer. Any idea on how to fix this?
Also, what does all the other stuff mean below the "net use" line?
https://imgur.com/a/IScom
Stuff below which net use line? You're showing two.
Be specific in your question please.
-
- Posts: 3
- Joined: 21 Jan 2015 22:12
Re: Problems printing with DOS program using "net use lpt1"
How would I go about fixing the problem? Would changing it to LPT2 or LPT3 in the bat file fix the issue?
I forgot to mention that I am the admin user if that makes a difference.
I forgot to mention that I am the admin user if that makes a difference.
-
- Expert
- Posts: 1163
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Problems printing with DOS program using "net use lpt1"
Try deleting the port with before running the script.
Code: Select all
net use LPT1: /Delete
-
- Expert
- Posts: 1163
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Problems printing with DOS program using "net use lpt1"
And as for what everything else does...
Code: Select all
:: Prevent the commands from being displayed on the command prompt as they are being run
@echo off
:: Go to the D:\BOOKS directory. This could also have been achieved with the command cd /d D:\BOOKS
D:
CD \BOOKS
:: Run FOXR.exe with the options BL and -T. I have no idea what this does. Google is telling me that foxr.exe is FoxPro, but that isn't how you use the B or L flags.
FOXR BL -T
:: Goes to D:\
CD \
:: Outputs either a ÿ or a space, depending on your code page. Honestly, there's probably no reason for this line.
ECHO ÿ
Re: Problems printing with DOS program using "net use lpt1"
I am wondering why you took a picture of the screen when doing a screenshot or just copying and pasti g from the programs would have been a lot easier for everyone.
-
- Posts: 3
- Joined: 21 Jan 2015 22:12
Re: Problems printing with DOS program using "net use lpt1"
Do I just open cmd window and put in the delete code? Or should I put it as the first line of the bat file?
If I do it with a cmd window, do I have to do this everytime I turn on the computer? Or is there a way to do it automatically?
If I do it with a cmd window, do I have to do this everytime I turn on the computer? Or is there a way to do it automatically?
ShadowThief wrote:Try deleting the port withbefore running the script.Code: Select all
net use LPT1: /Delete
-
- Expert
- Posts: 1163
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Problems printing with DOS program using "net use lpt1"
Well, first I would try out the command to see if it even works. Just put the code in a command prompt.
And then if it does fix the problem, I would reboot and see if the problem comes back.
And then if it does fix the problem, I would reboot and see if the problem comes back.
- If the problem is initially fixed but comes back after the reboot, you need to add the line to the top of the batch file.
- If the problem is initially fixed and does not come back after the reboot, don't worry about it.
-
- Posts: 1
- Joined: 05 Feb 2015 09:14
Re: Problems printing with DOS program using "net use lpt1"
This Microsoft article may also help: http://support.microsoft.com/kb/253821/