USB Printer map

本文介绍在Windows系统中进行USB打印机映射的步骤。先正常安装打印机,分配共享名,选择未使用的LPT端口,用命令建立连接,可将命令插入脚本。验证连接后,更改打印机数据流模式。还给出测试配置、删除连接的方法及编辑hosts文件的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The first step is to install the USB printer normally into Windows. Once the printer is installed and the obligatory test pages print correctly, proceed to the following steps.

Assign the printer a shared name. Generally this happens during installation, but if you skipped that step or somehow installed the printer without giving it a resource name, do that now.

Share names should be alphanumeric (the first letter must be an alphabetic character). Even though share names can contain spaces, I recommend not putting spaces in resource names. The reason is because it's more difficult to use commands like:

net view \\my computer name  

If the Network Nazi for your system insists on names with embedded spaces, here's a way to do it:

net view \\"my computer name"  

Next, pick an unused LPT port.
At the operating system prompt, enter the following command:

net use  LPT1  \\computer_name\HP  /Persistent:Yes

where:

LPT1 is the name of the printer port. Note that a colon (:) does not appear after the port name on the command line.

\\computer_name is the name of the computer that is attached to the USB printer.

HP is the resource name of the USB printer.

/Persistent:Yes denotes that this connection should be reestablished when the system is rebooted.

The above command line can be inserted into the autoexec.bat or network login script, whichever is most appropriate for your installation.


To verify that the connection was successful, use this command:

net view \\computer_name

After the LPT port has been associated with the USB port, open the printer configuration panel (Start | Settings | Control Panel | Printers | Right Click on the Printer | Properties) and change the data stream from RAW to Text mode. Use these steps:
Choose the Advanced tab or button
Choose the Print Processor button
In the Data Type section, change the data type from RAW to TEXT.
Apply and Close the printer panel.


To test that the printer has been successfully configured, at the command prompt, execute:
dir > lpt1:

Small directory listings won't have enough information to force a page to eject, so you might have to repeat this a couple times to get a page to actually print.


Deleting the Connection
To delete the LPT port connection, use the command:

net use LPT1 /Delete

You can do it on the same PC the USB Printer is installed.

Steps to follow:

1. You have to edit the hosts file in your windows directory e.g. c:\windows\system32\drivers\etc(for XP), c:\winnt\system32\drivers\etc(for W2k) and add the following entry
YOUR-SYSTEM-IP COMPUTER-NAME
Now save the host file.

2. Use following command
(For Temporary Basis)
Net Use LPT1 \\computername\printersharedname

(For Permanent Basis)
Net Use LPT1 \\computername\printersharedname /yes

I have tested it on my PC(XP) and it works fine.

转载于:https://www.cnblogs.com/Qia_sky/archive/2005/09/28/245660.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值