Thanks Sergey, very useful explanation, as ever!
Fernando
>The SetDefaultPrinter Win API function is only available in WIn2K and later. The SetDefaultPrinter WSH method is supported under Win98 and later. Besides that there shouldn't be any difference between them.
>
>>Hi,
>>
>>Doing a search in messages area I saw both methods (shown below) for doing that. There is one that works better, or is recommended?
>>
>>Assuming:
>>
>>cPrinterName = "PDF995"
>>
>>
Method 1:>>
>>Declare Integer SetDefaultPrinter In WINSPOOL.DRV String @pPrinterName
>>
>>SetDefaultPrinter (@cPrinterName)
>>
>>
Method 2:>>
>>oSetDefPrinter = CreateObject("WScript.Network")
>>
>>oSetDefPrinter.SetDefaultPrinter(cPrinterName)
>>
>>Release oSetDefPrinter
>>
>>TIA,
>>
>>Fernando