Solved

unable to connect linux share printer with net use command

Posted on 2013-12-13
7
502 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…

828 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