求助!如何用VBS脚本实现更改打印机默认纸张格式!!!
我刚刚学习脚本语言,现在遇见以下问题,请各位高手救急!
我想通过VBS脚本更改打印机的默认纸张格式:现初步编码如下:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_PrinterConfiguration where Name = 'Epson LQ-1600K'")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name
Wscript.Echo "Paper Length: " & objPrinter.PaperLength
Wscript.Echo "Paper Width: " & objPrinter.PaperWidth
objPrinter.Name = "Epson LQ-1600K1"
objPrinter.PaperLength = 2970
objPrinter.PaperWidth = 2100
Wscript.Echo "Name: " & objPrinter.Name
Wscript.Echo "Paper Length: " & objPrinter.PaperLength
Wscript.Echo "Paper Width: " & objPrinter.PaperWidth
Next
但这样写设置不能保存!
想使用 objPrinter.Put_ 命令保存信息却提示:SWbemObjectEx: 提供程序无法执行该操作
请各位帮帮忙!急!
leonfox@126.com