Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

unable to connect linux share printer with net use command

Posted on 2013-12-13
7
Medium Priority
?
527 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

927 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