使用下面的标本,保存为*.bat 文件

@echo off
echo Add Printer
echo ....
sc config spooler start= auto
net stop spooler & net start spooler
net use \\服务器\IPC$ "密码" /user:"用户"
rundll32 printui.dll,PrintUIEntry /in /n "\\服务器\打印机名"
echo finish
pause