Solved

unable to connect linux share printer with net use command

Posted on 2013-12-13
7
512 Views
Last Modified: 2014-04-25
I was trying to connect linux printer with 'NET USE' command from DOS. I was able to test print successfully from CUPS. I was also able to map the printer to Window 7 by typing the correct \\192.168...\printer_name and got a result from test print page.

When I connect to the printer with net use like this:
NET USE LPT2 \\192.168....\printer_name I was able to connect successfully but when I tried

copy C:\test.txt LPT2: I got this error: "LPT2" is not a recognized device. Access denied
I also tried print /:d LPT2 C:\test.txt I got this error: unable to initialize device LPT2.

What else do I need to do in order to make it work?
1. Was there a setting error in smb.conf?
2. Do I need to configure something in Window 7?
0
Comment
Question by:kisegi
[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
  • 4
  • 3
7 Comments
 
LVL 88

Expert Comment

by:rindi
ID: 39718443
Try your commands with the following syntax:

copy "c:\test.txt" lpt2

print "c:\test.txt" /D:lpt2

In the first command there is no : after lpt2, and in the second command the file to print comes before where to print to. Also in /D:lpt2 the ":" comes after the D, and not between the / and the D, and there is no space to lpt2.
0
 

Author Comment

by:kisegi
ID: 39719499
I tried the command and still output the same error as in Access denied and unable to initialize device LPT2.

Any other suggestions? Perhaps setting issue with smb.conf or an alternative route for netBIOS? (just my thoughts I've configured the smb.conf with my best knowledge). Thanks.
0
 
LVL 88

Expert Comment

by:rindi
ID: 39719785
If you were able to map it properly using the net use command, it is working on the Linux side. Make sure your printer is still mapped to lpt2 (net use). If it is, recheck your syntax and spelling, if not, map it again.
0
Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

 

Author Comment

by:kisegi
ID: 39720541
this is what I've typed:

net use lpt2 \\ip_address\printer_name

then I check against the net use and I see this:

status    local     remote                                       network
ok           lpt2     \\ip_address\printer_name      Microsoft Windows Network

This confirmed that I've mapped correctly.

Then I type this under command prompt:

copy c:\test.txt lpt2

this showed up:
Access is denied.
   0 file(s) copied.

I also tried this command:

print c:\test.txt /D:lpt2

this showed up:
Unable to initialize device lpt2

what can be the cause of "Unable to initialize device lpt2"?
0
 
LVL 88

Expert Comment

by:rindi
ID: 39721399
Open the cmd prompt as administrator. "access denied" could mean that you aren't allowed to access the test.txt file as a normal user (which is how it should be for files in the root of C:\).
0
 

Accepted Solution

by:
kisegi earned 0 total points
ID: 39899209
Thanks all for the great support and comment. I've decided to move off from the print function because a newer system was introduced into the company. This system will simply work with the print server (CUPS) setup through the CUP GUI web interface. I don't really need to setup the printer from net use command in windows.
0
 

Author Closing Comment

by:kisegi
ID: 40022135
Alternative solution has been used
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

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