Hi,
Thanks,
Hi,
Thanks,
Before trying to print via code, have you tested a test print page using the control panel interface on the printer properties page?
Hi,
Am able to give the print though ControlPanel->Device and Printers but not through script.
I made a simple C++ app : EnumeratePrinters.zip
which also does a Test Page print
You can test it to check if you get the same error...
Hello,
Did you try to print a text file form a notepad before testing the code?
Is the installed driver is matching the printer model?
Hi,
What's the type of the problematic printer?
Was the printer directly deployed on the machine that proceed the Test Print? Or was the printer installed on a printer server and shared to the machine you proceed Test Print?
And what's the OS version of this machine? Please run command "winver" to take a screenshot of the OS information.
Thanks,
Eleven
Please post the script that you are using. From what you have shared, it doesn't look like it will work as you need to cycle through the printers available. A direct call will fail. Try the following code from this blog https://devblogs.microsoft.com/scripting/how-can-i-print-a-test-page-to-a-printer/
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
Set colPrinters = objWMIService.ExecQuery _
(“Select * from Win32_Printer Where DeviceID = ‘\\\\atl-ps-01\\color-printer'”)
For Each objPrinter in colPrinters
errReturn = objPrinter.PrintTestPage
If errReturn = 0 Then
Wscript.Echo “The test page was printed successfully.”
Else
Wscript.Echo “The test page could not be printed.”
End If
Next
Are you sure you set the right printer name (and not the printer driver name) ?
Hello,
In your code can you try to send the print job the the printer IP instead of the printer name ?
Hello,
When you say I "configured/Install the printer using IP Address only", so I would like to be sure that is not an issue with the name resolution.
Are you able to resolve the printer name to IP ? so you are able to ping the printer using the printer name the printer name ?
8 people are following this question.