Solved

PRINTING TO A NETWORK PRINTER FROM DOS APPLICATION USING IP ADDRESS

Posted on 2004-10-03
18
300 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 19

Expert Comment

by:Arno Koster
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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…
With the rising number of cyber attacks in recent years, keeping your personal data safe has become more important than ever. The tips outlined in this article will help you keep your identitfy safe.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 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