Solved

PRINTING TO A NETWORK PRINTER FROM DOS APPLICATION USING IP ADDRESS

Posted on 2004-10-03
18
297 Views
Last Modified: 2010-04-14
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
Comment
Question by:ISRAELRGARCIA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +3
18 Comments
 
LVL 9

Expert Comment

by:imnajam
ID: 12213161
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
 

Author Comment

by:ISRAELRGARCIA
ID: 12213390
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
 
LVL 12

Expert Comment

by:valicon
ID: 12213745
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 19

Expert Comment

by:akoster
ID: 12215053
maybe the "device in use" states that the LPT1 port is already in use rather than the printer being in use ?
0
 
LVL 9

Expert Comment

by:imnajam
ID: 12215206
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
 
LVL 9

Accepted Solution

by:
imnajam earned 500 total points
ID: 12215207
0
 
LVL 1

Expert Comment

by:HatchIT
ID: 12216292
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
 

Author Comment

by:ISRAELRGARCIA
ID: 12217466
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
 
LVL 12

Expert Comment

by:valicon
ID: 12222623
Yes the network name is your IP address of the printer.  You are correct :)
0
 
LVL 6

Expert Comment

by:Scott_Willcocks
ID: 12224876
@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
 
LVL 1

Expert Comment

by:HatchIT
ID: 12297229
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
 
LVL 9

Expert Comment

by:imnajam
ID: 12300013
hi HatchIT,
isn't it what I just said?
0
 

Author Comment

by:ISRAELRGARCIA
ID: 12301358
THANKS -- I FINALLY GOT IT TO PRINT....
0
 
LVL 9

Expert Comment

by:imnajam
ID: 12311080
you welcome, and congrats for the success
0
 
LVL 9

Expert Comment

by:imnajam
ID: 14249302
The problem is solved and there should be a split point or an accepted answer to this question.
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question