• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

PRINTING TO A NETWORK PRINTER FROM DOS APPLICATION USING IP ADDRESS

I HAVE A SMALL WINDOWS NT 4 NETWORK WHERE ALL THE WORKSTATIONS ARE RUNNING WINDOWS 2000 PRO. I HAVE RECENTLY PURCHASED A LEXMARK C510N PRINTER. I HAVE CONNECTED THE PRINTER DIRECTLY TO THE HUB AND ASSIGNED IT AN IP ADRESS. ALL THE WORKSTATIONS CAN PRINT FOR WINDOWS APPLICATIONS THROUGH THIS PRINTER. WE CANNOT PRINT FROM OUR DOS APPLICATION. WE HAVE TRIED REDIRECTING THRU
'NET USE' AND GET MIXED ERROR MESSAGES NEED HELP DESPARETELY..

IG
 
0
ISRAELRGARCIA
Asked:
ISRAELRGARCIA
  • 6
  • 3
  • 2
  • +3
1 Solution
 
imnajamCommented:
can you quote the errors you get?
also tell me if you TICK on enable printing from DOS - BASED application when installing a remote printer
0
 
ISRAELRGARCIAAuthor Commented:
ERRORS ARE USUALLY "NETWORK NAME NOT FOUND", AND THE REST ARE SYNTAX ERRORS WHICH IS ASSUME HAVE TO DO WITH MY NOT KNOWING THE PROPER "DEVICE NAME", "NETWORK NAME", AND OR COMPUTER NAME.  AS TO "TICK" ING ON ENABLE PRINTING FROM DOS - BASED APPLICATIONS WHEN INSTALLING A REMOTE PRINTER.... I AM NOT SEEING THE PROMPT AT ALL.

MY NET USE SYNTAX IS AS FOLLOWS:

NET USE LPT1 \\192.168.2.50\LEXMARK C510 PS3 /PERSISTENT:YES
I USE IP ADDRESS AND PRINTER NAME
MSG NETWORK NAM NOT FOUND
OR
NET USE LPT3  \\SERVER_P5002\LEXMARK C510 PS3 /PERSISTENT:YES
WHERE LPT3 IS A TCPIP PORT CREATED AND WHERE SERVER_P5002 IS THE ACTUAL WINDOWS NT4 SERVER THAT ALL WORKSTATIONS WORK FROM.
MSG SYNTAX IS:
OR
NET USE LPT1 \\LEXMARK C510 PS3
MSG DEVICE IN USE
0
 
valiconCommented:
Hi,

Your syntax is correct.  

http://support.microsoft.com/default.aspx?kbid=154498


You can try this little shareware programs also:

http://www.dosprn.com


0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Arno KosterCommented:
maybe the "device in use" states that the LPT1 port is already in use rather than the printer being in use ?
0
 
imnajamCommented:
first of all solution to the error ("NETWORK NAME NOT FOUND",) is that you need to modify your command as follows

NET USE LPT1 "\\192.168.2.50\LEXMARK C510 PS3" /PERSISTENT:YES

because your shared printer names contains SPACES ..... so you have to put the address in double quotation

also check out how to install a remote printer!

all the best!
0
 
imnajamCommented:
0
 
HatchITCommented:
I'd agree with imnajam.  Any time you're doing ANYTHING from a command prompt (or DOS window), it's best if there are no spaces in the file name, folder name, share name, etc.  If possible, rename the printer share on the print server to something with no spaces, perhaps "LexC510"?  It'd make life much easier.  Otherwise, the entire path would need to be put into quotes, as in "\\192.168.2.50\LEXMARK C510 PS3", or if it was a file share "\\servername\your share name here", or even "C:\Documents and Settings" if you wanted to get to a local file or folder through a command prompt.

Hope this helps clear things up for you.
0
 
ISRAELRGARCIAAuthor Commented:
I WILL TRY THESE OPTIONS TODAY.... I THANK YOU AND I FEEL THAT THIS MAY BE THE ANSWER....JUST ONE LAST QUESTION---WHAT IS MY NETWORK NAME... AM I RIGHT IN THINKING THAT IT WOULD BE THE IP ADDRESS?????
0
 
valiconCommented:
Yes the network name is your IP address of the printer.  You are correct :)
0
 
Scott_WillcocksCommented:
@ECHO OFF

Rem **** Batch file to map printer \\IP address\printer Name ***
Rem **** Printer name should be no more than 7 characters ***
Rem **** Printer Name should contain no spaces ***
Rem **** Attach the script to a application group for dos ***
Rem **** or add to logon ***
Rem **** Always delete the port first before asigning in case it is allready in use ***
Rem *** 05/10/04 ***
Rem ** Scott Willcocks ***



NET USE LPT1: /DELETE
NET USE LPT1: \\IP ADDRESS\PRINTERNAME /PERSISTENT:NO >nul

NET USE LPT2: /DELETE
NET USE LPT2: \\IP ADDRESS\PRINTERname /PERSISTENT:NO >nul


0
 
HatchITCommented:
Erm, no, your network name is not the IP Address.  The network name error you're getting basically means that the share that you entered does not exist.  In your case, since you're going from a command prompt (or batch file), it probably means you've entered a server or share name that has a space in it without enclosing it in quotes (e.g. "\\server name\share name").  One way to get around problems with the server name is to use the IP address instead.

For instance, if you were to try to map a drive to a share called <\\servername\My Share> with a command like 'net use z: \\servername\my share', it won't work.  You'd need to use 'net use z: "\\servername\my share"' to make it work.  You could also use the IP address instead of the server name, and you'd get a command like 'net use z: "\\<ip address>\my share"', which would serve the same purpose.

Hope this makes sense.  Bascially, for most things you are trying to do with a "\\servername" type entry, you can either use the actual server name OR the IP address for <servername>.
0
 
imnajamCommented:
hi HatchIT,
isn't it what I just said?
0
 
ISRAELRGARCIAAuthor Commented:
THANKS -- I FINALLY GOT IT TO PRINT....
0
 
imnajamCommented:
you welcome, and congrats for the success
0
 
imnajamCommented:
The problem is solved and there should be a split point or an accepted answer to this question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 6
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now