in the http://windyma.blog.51cto.com/661702/1967027 article, the user script is done on the basis of
In the script file Kixtart.kix, add the following:
---------------------------------------
IF INGROUP ("Color_printer")
If addprinterconnection ("\\zsprinter.nccn.int\NEO-Color-Printer") = 0
? "Added neo-color-printer Connection ..."
Endif
Endif
; Add the Neo-mono-printer printer as the default printer
If addprinterconnection ("\\zsprinter.nccn.int\NEO-Mono-Printer") = 0
? "Added neo-mono-printer Connection ..."
If setdefaultprinter ("\\zsprinter.nccn.int\NEO-Mono-Printer") = 0
? "Set default printer to Neo-mono-printer ..."
Endif
Endif
To add another printer to a different printer user and set as the default printer
IF INGROUP ("Small_printer")
If addprinterconnection ("\\zsprinter.nccn.int\Small-Printer") = 0
? "Added printer to Small-printer ..."
If setdefaultprinter ("\\zsprinter.nccn.int\Small-Printer") = 0
? "Set default printer to Small-printer ..."
Endif
Endif
Endif
The script to add a printer to Kix has been completed, but there is also a problem is that when the Windows system never installed the above printer driver, the general AD user is not authorized to install, Windows7 computer will play a box to enter a user name and password to install the permissions, However, XP computers are not successfully installed directly.
So we have to help the computer to automatically install the driver, we are in the domain for computer-like add a Group Policy, Group Policy Computer Configuration---Policy---windows settings----script (Startup/shutdown)---Startup items Add a Printerdriver.cmd file with the following content (add different drivers depending on the system 32-bit or 64-bit):
--------------------------------------------
@echo off
Goto%processor_architecture%
: x86
IF not EXIST "C:\Windows\system32\spool\DRIVERS\W32X86\3\KOAYQJAT.dll" (rundll32 printui.dll,printuientry/ia/m " Generic 36C-6SERIESPCL "/F \\zsprinter.nccn.int\Driver\ADC286_Printer\Win_x86\KOAYQJA_. inf/u)
IF not EXIST "C:\Windows\System32\spool\drivers\W32X86\3\KOAYXJAG. DLL "(rundll32 printui.dll,printuientry/ia/m" Generic 42bw-4seriespcl "/F \\zsprinter.nccn.int\Driver\AD289_Printer\ Win_x86\koayxja_. inf/u)
IF not EXIST "C:\Windows\system32\spool\DRIVERS\W32X86\3\GWP. DLL "(rundll32 printui.dll,printuientry/ia/m" Generic 21bw-3 PCL "/F \\zsprinter.nccn.int\Driver\AD219_Printer\32\GWP . inf/u)
Goto END
: AMD64
IF not EXIST "C:\Windows\system32\spool\DRIVERS\x64\3\KOAYQJAT.dll" (rundll32 printui.dll,printuientry/ia/m "Generic 36c-6seriespcl "/F \\zsprinter.nccn.int\Driver\ADC286_Printer\Win_x64\KOAYQJA_. inf/u)
IF not EXIST "C:\Windows\system32\spool\DRIVERS\x64\3\KOAYXJAG. DLL "(rundll32 printui.dll,printuientry/ia/m" Generic 42bw-4seriespcl "/F \\zsprinter.nccn.int\Driver\AD289_Printer\ Win_x64\koayxja_. inf/u)
IF not EXIST "C:\Windows\System32\spool\drivers\x64\3\GWP. DLL "(rundll32 printui.dll,printuientry/ia/m" Generic 21bw-3 PCL "/F \\zsprinter.nccn.int\Driver\AD219_Printer\64\GWP . inf/u)
: End
Exit
This article is from the "Water-ice" blog, make sure to keep this source http://windyma.blog.51cto.com/661702/1967048
AD Script KiXtart Three (add Windows shared printer)