cscript C:\Windows\System32\Printing_Admin_Scripts\ru-RU\prnport.vbs -a -r "192.168.0.30" -h "192.168.0.30" -o RAW -n 9100
cscript C:\Windows\System32\Printing_Admin_Scripts\ru-RU\prndrvr.vbs -a -m "HP LaserJet M1530 MFP Series PCL 6" -e "Windows NT x86" -h "C:\drivers\1536\"-i "C:\drivers\1536\hpc1530c.inf"
&rundll32 printui.dll,PrintUIEntry /if /b "HP LaserJet M1530 MFP Series PCL 6" /r "192.168.0.30" /m "HP LaserJet M1530 MFP Series PCL 6" /u /K /q /Gw
function Add-PrinterPort ($printersource) { cscript C:\Windows\System32\Printing_Admin_Scripts\ru-RU\prnport.vbs ` -a -r $printersource -h $printersource -o RAW -n 9100 | Out-Null } function Add-PrinterDriver ($printername, $driverpath) { $folder = Split-Path $driverPath cscript C:\Windows\System32\Printing_Admin_Scripts\ru-RU\prndrvr.vbs ` -a -m $printername -e Get-Platform -h $folder -i $driverpath } function Get-Platform { if ([System.Environment]::Is64BitOperatingSystem) { "Windows x64" } else { "Windows NT x86" } } Add-Type -As Microsoft.VisualBasic $printerSource = [Microsoft.VisualBasic.Interaction]::InputBox(" IP .") if ($printerSource -match "^192\.168\.0\.[0-9]{1,3}$") { $printername = "HP LaserJet M1530 MFP Series PCL 6" $driverpath = "C:\drivers\1536\hpc1530c.inf" Add-PrinterPort $printersource Add-PrinterDriver $printername $driverpath # & &rundll32 printui.dll,PrintUIEntry /if /b $printername /r $printersource /m $printername /u /K /q /Gw Start-Sleep -Seconds 10 }
; Windows Vista
[HP.NT.6.0]
"HP LJ M1530 MFP Series Scan" = WIA_1530_Inst.NT.6.0, USB \ vid_03f0 & pid_012a & mi_00
"HP LJ M1530 MFP Series Scan" = WIA_1530_NW.NT.6.0, vid_03f0 & pid_012a & IP_SCAN
; Windows Vista 64
[HP.NTAMD64.6.0]
"HP LJ M1530 MFP Series Scan" = WIA_1530_Inst_Vista64, USB \ vid_03f0 & pid_012a & mi_00
"HP LJ M1530 MFP Series Scan" = WIA_1530_NW_Vista64, vid_03f0 & pid_012a & IP_SCAN
DevCon is a command-line program that is used as an alternative to the device manager. With its help, you can turn on, turn off, restart, update, delete, and poll individual devices or groups of devices. DevCon also provides information needed by the driver developer that is not available through Device Manager.
support.microsoft.com/kb/311272/en
.\devcon.exe /r install C:\drivers\1536scan\hppasc16.inf "vid_03f0&pid_012a&IP_SCAN"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Class \ {6BDD1FC6-810F-11D0-BEC7-08002BE2092F} \ _ ITEM_ \ DeviceData]
"NetworkDeviceID" = "\\ hostname: _NETWORK_NAME_.domain.local \\ ipaddr: _IP_ADDRESS _ \\ guid: \\ macaddr: _MAC_ADDRESS _ \\ port: 1"
"PortID" = "_ IP_ADDRESS_"
"NetworkHostName" = "_ NETWORK_NAME_.domain.local"
"TulipIOType" = dword: 00000005
[HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Enum \ Root \ IMAGE \ _ITEM_ \ Device Parameters]
"NetworkDeviceID" = "\\ hostname: _NETWORK_NAME_.domain.local \\ ipaddr: _IP_ADDRESS _ \\ guid: \\ macaddr: _MAC_ADDRESS _ \\ port: 1"
"PortID" = "_ IP_ADDRESS_"
"NetworkHostName" = "_ NETWORK_NAME_.domain.local"
"MAC" = "_ MAC_ADDRESS_"
"PortNumber" = "1"
"Index" = "_ ITEM_"
$IP_ADDRESS = "192.168.0.30" $MAC_ADDRESS = "001b00b2cc00" $NETWORK_NAME = "NPI3CPOF7" $source = "C:\drivers\1536scan" $dest = Join-Path (Get-Location).path "\temporary" Copy-Item $source $dest -Recurse -Force $dest = Join-Path $dest "\hppasc16.inf" # devcon & .\devcon.exe /r install $dest "vid_03f0&pid_012a&IP_SCAN" $item = Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Control\Class\"{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}" | Select-Object -Last 1 $item = $item.Substring($item.Length-4, 4) $pattern = ".\temporary\1536.reg" $result = ".\temporary\res.reg" Get-Content $pattern | ForEach-Object { $_ -replace "_IP_ADDRESS_", $IP_ADDRESS ` -replace "_MAC_ADDRESS_", $MAC_ADDRESS ` -replace "_NETWORK_NAME_", $NETWORK_NAME ` -replace "_ITEM_", $item } | Set-Content $result & regedit /s .\temporary\res.reg
hppniscan01.exe -f "hppasc16.inf" -m "vid_03f0&pid_012a&IP_SCAN" -a "192.168.0.30" -n 1
C: \ Drivers \ Scanners \ ip \ 3055scan \ hpgtpusd.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ hppasc01.cat
C: \ Drivers \ Scanners \ ip \ 3055scan \ hppasc01.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ hppasc01.inf
C: \ Drivers \ Scanners \ ip \ 3055scan \ hppniscan01.exe
C: \ Drivers \ Scanners \ ip \ 3055scan \ hpptpml3.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ hpxp3390.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ Drivers \ dot4
C: \ Drivers \ Scanners \ ip \ 3055scan \ Drivers \ dot4 \ Win2000 \ hpzidr12.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ Drivers \ dot4 \ Win2000 \ hpzipm12.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ Drivers \ dot4 \ Win2000 \ hpzipr12.dll
C: \ Drivers \ Scanners \ ip \ 3055scan \ Drivers \ dot4 \ Win2000 \ hpzipr12.sys
function Add-PrinterPort ($printerSource) { &cscript C:\Windows\System32\Printing_Admin_Scripts\ru-RU\prnport.vbs ` -a -r $printerSource -h $printerSource -o RAW -n 9100 | Out-Null } function Add-PrinterDriver ($printerName, $driverPath) { $folder = Split-Path $driverPath &cscript C:\Windows\System32\Printing_Admin_Scripts\ru-RU\prndrvr.vbs ` -a -m $printerName -e Get-Platform -h $folder -i $driverPath } function Get-Platform { if ([System.Environment]::Is64BitOperatingSystem) { "Windows x64" } else { "Windows NT x86" } } function Add-Scanner ($ipaddress, $printername) { switch -regex ($printername) { # "1530" { Push-Location 'C:\Drivers\Scanners\ip\1536scan\' if ($(Get-Platform) -eq "Windows x64") { .\hppniscan64.exe -f "hppasc16.inf" -m "vid_03f0&pid_012a&IP_SCAN" -a $ipaddress -n 1 } else { .\hppniscan01.exe -f "hppasc16.inf" -m "vid_03f0&pid_012a&IP_SCAN" -a $ipaddress -n 1 } Pop-Location } "(305\d)|(3390)" { Push-Location 'C:\Drivers\Scanners\ip\3055scan\' switch -regex ($printername) { "3050" { .\hppniscan01.exe -f "hppasc01.inf" -m "vid_03f0&pid_3217&IP_SCAN" -a $ipaddress -n 1 } "3052" { .\hppniscan01.exe -f "hppasc01.inf" -m "vid_03f0&pid_3317&IP_SCAN" -a $ipaddress -n 1 } "3055" { .\hppniscan01.exe -f "hppasc01.inf" -m "vid_03f0&pid_3417&IP_SCAN" -a $ipaddress -n 1 } "3390" { .\hppniscan01.exe -f "hppasc01.inf" -m "vid_03f0&pid_3517&IP_SCAN" -a $ipaddress -n 1 } } Pop-Location } } } Add-Type -As Microsoft.VisualBasic $printerSource = [Microsoft.VisualBasic.Interaction]::InputBox(" IP .") if ($printersource -match "^192\.168\.0\.[0-9]{1,3}$") { $printername = "HP LaserJet M1530 MFP Series PCL 6" $driverpath = "C:\drivers\1536\hpc1530c.inf" Add-PrinterPort $printersource Add-PrinterDriver $printername $driverPath # & &rundll32 printui.dll,PrintUIEntry /if /b $printername /r $printersource /m $printername /u /K /q /Gw Start-Sleep -Seconds 10 Add-Scanner $printersource $printername }
Source: https://habr.com/ru/post/242513/
All Articles