The company that shares the printer is basically a desktop computer with a relatively good configuration. Install the XP system. Fixed IP address, configure the appropriate permissions and install the printer driver, here specifically, all computers do not open the Guest account, any shared access is required password, so batch processing is so Share_print.bat
Copy Code code 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
(as pictured):
1, the net use command is connected to the printer service host that needs to be connected, and here is a username and password.
2, call the Rundll32 command to invoke the dynamic Connection library on the command line, which is excerpted from the results of the network search, and if you want to know the specific other parameters and usage, enter Rundll32 printui.dll,PrintUIEntry in the Run command/? See Other related parameters, note/n followed by the shared printer's IP address and printer name
3, the last line of command is to set this shared printer as the default printer.
4, the above command saved as batch execution, to manually click to confirm the installation of the driver, here a lot of information is not well resolved. I hope that the solution must be sent out to learn. (as pictured):
5, after the point is, add the printer is finished, the command window also closed itself. You can see that the printer is connected successfully and is set to default.
6, the problem is, restart the computer will find that can not connect, because the system did not save the password. There will be another batch to solve the problem.
7, add a batch, again through net use to connect the shared printer computer copy to the boot up, so that after the boot can be directly printed without problems. But how do I copy it to the boot? And as soon as the user just starts to run batch processing once, after just a boot, can print? We do this:
Set up Copy.bat, which is the Copy connection printer and set as the default batch program to the boot startup project, then call this command to let it connect once, so that the user can print directly, and he restarted the computer, that is, waiting for the program to automatically perform a connection to the printer, click once OK, the other do not have to do anything.
8, after testing, because the connection to the shared printer requires network support, but many computers start very slowly, and the network is long to connect well, so after the improved Share_print.bat is this:
9, the text is to prompt the user to wait, but the background is really the ping, added 15 times parameter meaning is about to wait 15 seconds and so the network normal after the connection to the printer.
10, send two batches to the colleagues who need to connect to the printer, and let them perform the copy.bat.