Dos脚本调用打印机用户界面及配置

Dos脚本调用打印机用户界面及配置

一、命令帮助如下:

rundll32.exe printui.dll,PrintUIEntry /?

适用于:System32或SysWOW64

用法: rundll32 printui.dll,PrintUIEntry [options] [@commandfile]
   /a[file] 二进制文件名
   /b[name] 基本打印机名
   /c[name] 如果操作在远程机器上,unc 机器名
   /dl 删除本地打印机
   /dn 删除网络打印机连接
   /dd 删除打印机驱动程序
   /e 显示打印首选项
   /f[file] inf 文件或输出文件
   使用 /f 指定的 INF 文件可能依赖的 INF 文件的 /F[file] 位置
   /ga 添加每个机器打印机连接(用户登录时此连接将传播到用户)
   /ge 枚举每个机器打印机连接
   /gd 删除每个机器打印机连接(用户登录时此连接将被删除)
   /h[arch] 驱动程序体系结构,为下列之一: x86 或 x64 或 Itanium 
   /ia 用 INF 文件安装打印机驱动程序
   /id 用添加打印机驱动程序向导安装打印机驱动程序
   /if 用 INF 文件安装打印机
   /ii 用带 INF 文件的添加打印机向导安装打印机
   /il 用添加打印机向导安装打印机
   /in 添加网络打印机连接
   /ip 使用网络打印机安装向导安装打印机
   /j[provider] 打印提供程序名称
   /k 将测试页打印到指定的打印机,不能安装打印机时的命令组合
   /l[path] 打印机驱动程序源路径
   /m[model] 打印机驱动程序型号名
   /n[name] 打印机名
   /o 显示打印机队列查看
   /p 显示打印机属性
   /q 安静模式,不显示错误信息
   /r[port] 端口名
   /s 显示服务器属性
   /Ss 将打印机设置存到一个文件
   /Sr 从一个文件还原打印机设置
   储存或还原必须放在命令结尾的打印机设置选项标志:
	2	PRINTER_INFO_2
	7	PRINTER_INFO_7
	c	颜色配置文件
	d	打印机数据
	s	安全描述符
	g	全局 DevMode
	m	最低设置
	u	用户 DevMode
	r	解决名称冲突
	f	强制使用名称
	p	解析端口
	i	驱动程序名称冲突
   /u 如果已安装,则使用现有的打印机驱动程序
   /t[#] 起始的以零为基础的索引页
   /v[version] 驱动程序版本,为下列之一:“类型 2 - 内核模式”或“类型 3 - 用户模式”
   /w 如果在 INF 中找不到指定的驱动程序,则提示用户
   /y 将打印机设置为默认打印机
   /Xg 获得打印机设置
   /Xs 设定打印机设置
   /z 不要自动共享这台打印机
   /Z 不要自动生成打印机名
   /K 更改 /h 的含义,使 x86 或 x64 或 Itanium 接受 2、3、4,并更改 /v 的含义,使“类型 3 - 用户模式”接受 3
   /Z 共享这台打印机,只能跟 /if 选项一起使用
   /? 帮助信息
   @[file] 命令行参数文件
   /Mw[message] 确认命令之前显示警告消息
   /Mq[message] 确认命令之前显示确认消息
   /W[flags] 指定向导(APW 和 APDW)的标志和切换
	r	使向导可以从上一页重新启动
   /G[flags] 指定全局标志和切换
	w	抑制安装程序驱动程序警告 UI (超级静声模式)




例如:
   运行服务器属性: 
rundll32 printui.dll,PrintUIEntry /s /t1 /c\\machine
   运行打印机属性: 
rundll32 printui.dll,PrintUIEntry /p /n\\machine\printer
   本地运行添加打印机向导: 
rundll32 printui.dll,PrintUIEntry /il 
   在 \\machine: 
rundll32 printui.dll,PrintUIEntry /il /c\\machine 运行添加打印机向导
   运行队列查看: 
rundll32 printui.dll,PrintUIEntry /o /n\\machine\printer
   运行 INF 安装: 
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f c:\infpath\infFile.inf /r "lpt1:" /m "Brother DCP-128C"
   运行 INF 安装(具有 INF 依赖关系)。在此示例中,prnbr002.inf 依赖于 ntprint.inf
rundll32 printui.dll, PrintUIEntry /ia /m "Brother DCP-128C" /K /h x64 /v 3 /f "c:\infpath\prnbr002.inf" /F "c:\infpath\ntprint.inf"
   使用 INF 运行添加打印机向导: 
rundll32 printui.dll,PrintUIEntry /ii /f c:\infpath\infFile.inf
   使用内置打印机驱动程序添加打印机: 
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /r "lpt1:" /m "Brother DCP-128C"
   添加每个机器打印机连接(用户登录时此连接将传播到用户): 
rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer /j"LanMan Print Services"
   删除每个机器打印机连接(用户登录时此连接将被删除): 
rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer
   枚举每个机器打印机连接: 
rundll32 printui.dll,PrintUIEntry /ge /c\\machine
   使用 INF 添加打印机驱动程序: 
rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m "Brother DCP-128C" /h "x86" /v "Type 3 - User Mode" /f c:\infpath\infFile.inf
   使用 INF 添加打印机驱动程序: 
rundll32 printui.dll,PrintUIEntry /ia /K /c\\machine /m "Brother DCP-128C" /h "x86" /v 3
   添加内置打印机驱动程序: 
rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m "Brother DCP-128C" /h "Intel" /v "Type 3 - Kernel Mode"
   删除打印机驱动程序: 
rundll32 printui.dll,PrintUIEntry /dd /c\\machine /m "Brother DCP-128C" /h "x86" /v "Type 3 - User Mode"
   删除打印机驱动程序: 
rundll32 printui.dll,PrintUIEntry /dd /K /c\\machine /m "Brother DCP-128C" /h "x86" /v 3
   将打印机设置为默认打印机: 
rundll32 printui.dll,PrintUIEntry /y /n "printer"
   设置打印机注解: 
rundll32 printui.dll,PrintUIEntry /Xs /n  "printer" comment "My Cool Printer"
   取得打印机设置: 
rundll32 printui.dll,PrintUIEntry /Xg /n "printer"
   取得文件中的打印机设置保存结果: 
rundll32 printui.dll,PrintUIEntry /f "results.txt" /Xg /n "printer"
   设置打印机设置命令使用:
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" ?
   将所有打印机设置存入一个文件: 
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" ?
   从一个文件还原所有打印机设置: 
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat"
   将二级打印机信息存入一个文件: 
rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat" 2
   从一个文件还原打印机安全描述符: 
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" s
   从一个文件还原打印机全局 devmode 和打印机数据: 
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" g d
   从文件最少设置还原并分析端口名: 
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" m p
   启用打印机的客户端呈现: 
rundll32 printui.dll,PrintUIEntry /Xs /n"printer" ClientSideRender enabled
   禁用打印机的客户端呈现: 
rundll32 printui.dll,PrintUIEntry /Xs /n"printer" ClientSideRender disabled


二、打开“控制面板\所有控制面板项\设备和打印机”的脚本命令:

control Printers

打开“控制面板\所有控制面板项”的脚本命令:

control

以此类推......

 

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
用法: rundll32 printui.dll,PrintUIEntry [options] [@commandfile] /a[file] 二进制文件名 /b[name] 基本打印机名 /c[name] 如果操作在远程机器上,unc 机器名 /dl 删除本地打印机 /dn 删除网络打印机连接 /dd 删除打印机驱动程序 /e 显示打印首选项 /f[file] inf 文件或输出文件 /ga 添加每个机器打印机连接 /ge 枚举每个机器打印机连接 /gd 删除每个机器打印机连接 /h[arch] 下列驱动程序体系结构之一,Alpha | Intel | IA64 | x64 /ia 用 inf 文件安装打印机驱动程序 /id 用添加打印机驱动程序向导安装打印机驱动程序 /if 用 inf 文件安装打印机 /ii 用带 inf 文件的添加打印机向导安装打印机 /il 用添加打印机向导安装打印机 /in 添加网络打印机连接 /j[provider] 打印提供程序名称 /k 将测试页打印到指定的打印机,不能安装打印机时的命令组合 /l[path] 打印机驱动程序源路径 /m[model] 打印机驱动程序型号名 /n[name] 打印机名 /o 显示打印机队列查看 /p 显示打印机属性 /q 安静模式,不显示错误信息 /r[port] 端口名 /s 显示服务器属性 /Ss 将打印机设置存到一个文件 /Sr 从一个文件还原打印机设置 储存或还原必须放在命令结尾的打印机设置选项标志: 2 PRINTER_INFO_2 7 PRINTER_INFO_7 c 颜色配置文件 d 打印机数据 s 安全描述符 g 全局 DevMode m 最低设置 u 用户 DevMode r 解决名称冲突 f 强制使用名称 p 解析端口 /u 如果已安装,则使用现有的打印机驱动程序 /t[#] 起始的以零为基础的索引页 /v[version] 驱动程序版本属于下列中的一个: Windows 95、98 和 ME | Windows NT 4.0 | Windows NT 4.0 或 2000 | Windows 2000 或 XP| Windows XP /w 如果指定的驱动程序不在 inf 中,则提示用户 /y 将打印机设为默认打印机 /Xg 获得打印机设置 /Xs 设定打印机设置 /z 不要自动共享这台打印机 /Z 不要自动生成打印机名 /K 更改 /v 和 /h 的意义来将 Windows x64 和 Windows IA64 | Windows NT x86 | Windows NT Alpha_AXP | Windows 4.0 分别接受为 0、1、2、3 /Z 共享这台打印机,只能跟 /if 选项一起使用 /? 帮助信息 @[file] 命令行参数文件 /Mw[message] 确认命令之前显示警告消息 /Mq[message] 确认命令之前显示确认消息 /W[flags] 指定向导(APW 和 APDW)的标志和切换 r 使向导可以从上一页重新启动 /G[flags] 指定全局标志和切换 w 抑制安装程序驱动程序警告 UI (超级静声模式) 例如: 运行服务器属性: rundll32 printui .dll ,PrintUIEntry /s /t1 /n\\machine 运行打印机属性: rundll32 printui .dll ,PrintUIEntry /p /n\\machine\printer 在本地运行添加打印机向导: rundll32 printui .dll ,PrintUIEntry /il 在 \\machine: rundll32 printui .dll ,PrintUIEntry /il /c\\Machine 运行添加打印机向导 运行队列查看: rundll32 printui .dll

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

pulledup

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值