Solved

unable to connect linux share printer with net use command

Posted on 2013-12-13
7
489 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 87

Expert Comment

by:rindi
Comment Utility
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
Comment Utility
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 87

Expert Comment

by:rindi
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:kisegi
Comment Utility
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 87

Expert Comment

by:rindi
Comment Utility
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
Comment Utility
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
Comment Utility
Alternative solution has been used
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now