Solved

unable to connect linux share printer with net use command

Posted on 2013-12-13
7
498 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
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

803 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