>Does anyone know a simple way to get the portname/sharename of the windows default printer? The reason for this is that I need to reset it back after the user changes it from the common dialog (which needs to be done as I'm printing from another application) and I'm using defprint which requires either of these as an argument. I can't seem to find any Foxpro or API functions which return this. Thanks in advance for any help.
>
Is there something wrong with the return from SET('PRINTER',2)?
You can use the Wscript.Network object to create an enumeration of available ports and their respective network mappings.