**DONOTDELETE**
(Lurker)
1999-05-20 06:11 PM
Determining the Default Printer

I know there is a command to set the default printer (SETDEFAULTPRINTER), but is there a way to determine which printer is currently set as the default?

**DONOTDELETE**
(Lurker)
1999-05-21 02:00 AM
Re: Determining the Default Printer

This following works for me:

$PrinterKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"
$PrinterVal = "Device"
$TempString = READVALUE ($PrinterKey, $PrinterVal)

;The Printername is the first part of the registry value
$x = INSTR($TempString,",")
$TheAnswer = SUBSTR($TempString,1,$x-1)

With kind regards,
Taco Ditiecher.