Announcement

Collapse
No announcement yet.

Run a wscript (user default printer)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Run a wscript (user default printer)

    Is it possible to run a wscript against a group of computers? I have a script to determine the users default printer, but I can't figure out how to run it, or if there's another way to get the information

  • #2
    Re: Run a wscript (user default printer)

    Can you post your script so we can see what exactly it's doing?

    Comment


    • #3
      Re: Run a wscript (user default printer)

      WScript.Echo GetDefaultPrinter

      Function GetDefaultPrinter
      sComputer = "."
      Set oWMIService = GetObject("winmgmts:\" & sComputer & "\root\cimv2")
      Set colItems = oWMIService.ExecQuery("Select * from Win32_Printer",,48)
      For Each oItem in colItems
      If (oItem.Attributes And 2^(3-1)) = 4 Then
      sDefault = oItem.Name
      Exit For
      End If
      Next
      GetDefaultPrinter = sDefault
      End Function

      Comment


      • #4
        Re: Run a wscript (user default printer)

        Try this to see if it gives you what you want without using your script:

        Select a few computers in Hyena, then right-click and choose WMI->Execute Query->Printers. In the Where Clause box type in:

        Default = 'True'

        Click Execute Query.

        Comment


        • #5
          Re: Run a wscript (user default printer)

          That seems to be close to what I am trying to get. It returns what I assume is the default printer for the default profile. The information I'm trying to extract is the default printer for the current user. Not sure if that is possible.

          Comment


          • #6
            Re: Run a wscript (user default printer)

            I'm not sure on that one either, unfortunately.

            Comment

            Working...
            X