Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Local area Network Printer sharing through batch bat

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to solve the problem of LAN printer sharing through batch processing bat, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The computers that the company shares printers are basically well-configured desktop computers. Install the XP system. Fix the IP address, configure the appropriate permissions and install the printer driver. It is stated here that all computers do not open guest accounts, and any shared access requires a password, so batch processing is like this share_print.bat.

The code is as follows:

@ echo off net use\\ 192.168.1.230\ IPC$ "password" / user: "user name" rundll32 printui.dll,PrintUIEntry / in / u / z / Q / n "\\ 192.168.1.230\ HPLaserJ1319" rundll32 printui.dll,PrintUIEntry / y / n "\\ 192.168.1.230\ HPLaserJ1319"

Note: PrintUIEntry is case sensitive

(figure):

1. First, net use commands to establish a connection with the printer service host that needs to be connected. There is a user name and password here.

2. Call the rundll32 command to invoke the dynamic link library on the command line. This line is extracted from the results of the network search. If you want to know other parameters and usage, type rundll32 printui.dll,PrintUIEntry /? in the run command. Check other relevant parameters and note that / n should be followed by the IP address and printer name of the shared printer.

3, the last command is to set this shared printer as the default printer.

4, after the above command is saved as a batch, you should manually click to confirm the installation of the driver, which has not been solved very well after consulting a lot of information here. I hope someone who has solved the problem must send it out to learn. (figure):

5, after clicking Yes, the printer is added and the command window closes by itself. You can see that the printer has been successfully connected and set to the default.

6, the problem comes, after restarting the computer, you will find that you can not connect, because the system does not keep the password. Here we need to add another batch to solve the problem.

7. Add a batch and reconnect the shared printer computer via net use to copy to the boot item, so that you can print directly without problems after boot. But how do you copy it to boot? And as long as the user just starts to run the batch once, and then as soon as it is turned on, it can print? Here's what we do:

Establish copy.bat, which is to copy and connect the printer and set the default batch program to the boot startup project, and then call this command to connect it once, so that the user can print directly, and after he restarts the computer, that is, wait for the program to automatically execute and connect to the printer, click once to determine what else you don't have to do.

8. After testing, because the connection to the shared printer requires network support, but many computers start slowly, and the network takes a long time to connect, so the improved share_print.bat looks like this:

9, the text is to prompt the user to wait, but the background is to execute the ping, adding 15 parameters means to wait about 15 seconds to wait for the network to be normal before connecting the printer.

10. Send the two batches to colleagues who need to connect to the printer and ask them to execute copy.bat.

The above is all the contents of the article "how to solve the problem of LAN printer sharing through batch bat". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report