scripting@wanadoo.nl




GetDefaultPrinter()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
26 March 2002 GetDefaultPrinter()
AuthorScriptLogic Corporation
Action Gets the name of the current user's default Windows printer.
SyntaxGetDefaultPrinter () 
Parameters 
RemarksSimple yet necessary function! 
ReturnsReturns a string value of the current users default printer, an empty string ("") is returned if there is an error. 
DependenciesNone. 
Examples
$DefaultPrinter=GetDefaultPrinter()
?'Your default printer is: '+$DefaultPrinter

 
Source
FUNCTION GetDefaultPrinter ()
  DIM $regkey, $regval
  $getdefaultprinter=''
  IF @inwin=1 ; NT
    $regkey='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows'
    $regexp=ReadValue($regkey,'Device')
    IF @error=0
      $getdefaultprinter=Substr($regexp,1,InStr($regexp,',')-1)
    ENDIF
  ELSE ; 9x
    $regkey='HKLM\Config\0001\System\CurrentControlSet\Control\Print\Printers'
    $getdefaultprinter=ReadValue($regkey,'Default')
  ENDIF
ENDFUNCTION ; - GetDefaultPrinter -
 
  original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
          printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


Site Meter