Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get name of windows default printer

Status
Not open for further replies.

repete

Programmer
Nov 14, 2000
151
AU
From Mike Gagnon's "Windows scripting guide, For VFP" (refer Faq184-2977) I can set a default printer in VFP by using the following code.

Code:
oNet = CREATEOBJECT("WScript.Network")
oNet.SetDefaultPrinter("\\slp_nt_termserv\Panasonic Printer")

Before I issue those commands, is there a way I can capture the existing windows default printer name, so that later in my code I can reset the default printer back to what it was. ?

Pete Bloomfield
Down Under
 
ok, so i should have looked harder......

?set("printer",2)

the wonderful thing here is that i found the answer on tek-tips, thanks guys...


Pete Bloomfield
Down Under
 
G'day Pete

lcDefaultWindowsPrinter = SET([PRINTER],2)


FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top