Page 1 of 1 1
Topic Options
#81901 - 1999-05-20 06:11 PM Determining the Default Printer
Anonymous
Unregistered


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?
Top
#81902 - 1999-05-21 02:00 AM Re: Determining the Default Printer
Anonymous
Unregistered


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.

Top
Page 1 of 1 1


Moderator:  Jochen, Radimus, Glenn Barnas, Allen, Arend_, ShaneEP, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 262 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.047 seconds in which 0.021 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org