Default printer is in the Registry here:

"HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows","Device"

On Tue, Sep 16, 2008 at 11:32 AM, Phil Brutsche <[EMAIL PROTECTED]> wrote:
> I have a VBS function that uses WMI:
>
>
> Function GetDefaultPrinter
>  Set oWMIService = GetObject("winmgmts:\\.\root\cimv2")
>  Set colItems = oWMIService.ExecQuery("Select * from Win32_Printer")
>  For Each oItem in colItems
>    if oItem.default then
>      sDefault = oItem.Name
>      Exit For
>    End If
>  Next
>  GetDefaultPrinter = sDefault
> End Function
>
> René de Haas wrote:
>> This I found also, do you also have something to get the default printer?
>>
>> I looked on google and found a script that looked at the registry, but that 
>> didn't work.
>> Looked like the registry didn't store it there.
>
> --
>
> Phil Brutsche
> [EMAIL PROTECTED]
>
> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~
> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~
>



-- 
ME2

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to