Solved

PRINTING TO A NETWORK PRINTER FROM DOS APPLICATION USING IP ADDRESS

Posted on 2004-10-03
18
292 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
  • 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now