Windows scripting

Anonymous
2020-09-28T15:47:21.177+00:00

Hi,

Thanks,

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,420 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Sean Liming 4,506 Reputation points
    2020-09-29T16:05:54.913+00:00

    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
    
    1 person found this answer helpful.

  2. George Aziz 441 Reputation points
    2020-09-28T16:58:15.937+00:00

    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?

    0 comments No comments

  3. Eleven Yu (Shanghai Wicresoft Co,.Ltd.) 10,671 Reputation points Microsoft Vendor
    2020-09-29T02:53:12.94+00:00

    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

    0 comments No comments

  4. George Aziz 441 Reputation points
    2020-10-04T18:49:55.383+00:00

    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 ?

    0 comments No comments

  5. firas badawi 1 Reputation point
    2020-10-05T01:56:43.117+00:00

    install the canon printer driver updates

    0 comments No comments