设为首页 加入收藏

TOP

win10x64 批处理自动安装打印机(一)
2019-08-24 00:09:26 】 浏览:78
Tags:win10x64 处理 自动 安装 打印机

系统版本:Windows 10企业版 64位(10.0 ,版本17134)- 中文(简体)

话不多说,直接上脚本:

REM 提升管理员权限
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
    goto UACPrompt 
) else (
    goto gotAdmin 
)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
cd /D "%~dp0"

rem auto install
@echo off
chcp 65001 >nul
title 柯美C226打印机自动安装程序
color 0a :printer ping 192.168.1.100 -n 1 | findstr /i "TTL" >NUL 2>NUL && goto fileserver echo Cannot connect to the printer ... goto end :fileserver echo Detected the printer is online ... ping 192.168.1.200 -n 1 | findstr /i "TTL" >NUL 2>NUL && goto driver echo Cannot find any drivers of the printer ... goto end :driver

rem 文件服务器共享目录,存放打印机驱动文件
net use \\192.168.1.200\fileserver /delete >nul net use \\192.168.1.200\fileserver password /user:username >nul if errorlevel 0 goto start echo Connect to the fileserver failed ... goto end :start echo Driver found ... rundll32 printui.dll,PrintUIEntry /dl /n "KONICA MINOLTA C266SeriesPS" /q echo 正在准备安装打印机,请耐心等待 ... rem add port reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports" /v StatusUpdateInterval /t REG_DWORD /d 0x0000000a /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports" /v StatusUpdateEnabled /t REG_DWORD /d 0x00000001 /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v Protocol /t REG_DWORD /d 0x00000002 /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v Version /t REG_DWORD /d 0x00000002 /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v HostName /t REG_SZ /d "192.168.1.100" /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v HWAddress /t REG_SZ /d "" /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v IPAddress /t REG_SZ /d "" /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v PortNumber /t REG_DWORD /d 0x00000203 /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.1.100" /v "SNMP Community" /t REG_SZ /d "p
首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇python面试题 下一篇python_分布式进程中遇到的问题

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目