Announcement

Collapse
No announcement yet.

Run a wscript (user default printer)

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

  • cmccullough
    Guest replied
    Re: Run a wscript (user default printer)

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

    Leave a comment:


  • melake
    replied
    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.

    Leave a comment:


  • cmccullough
    Guest replied
    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.

    Leave a comment:


  • melake
    replied
    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

    Leave a comment:


  • cmccullough
    Guest replied
    Re: Run a wscript (user default printer)

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

    Leave a comment:


  • melake
    started a topic Run a wscript (user default printer)

    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
Working...
X