Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Locating Default W2K or XP Pro Printer

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Windows - UNIX Interop] >> System & Network Admin Forum >> Locating Default W2K or XP Pro Printer Page: [1]
Login
Message << Older Topic   Newer Topic >>
Locating Default W2K or XP Pro Printer - Jul. 26, '03, 7:52:06 PM   
Dan

 

Posts: 1
Joined: Jul. 22, '03,
Status: offline
While rebuilding an application on Win2K that uses a " system" call to invoke " lpr" , I discovered that lpr no longer passes prints through to the default Windows print queue when a print destination is not identified. Under NT 4.0/SP 6a it worked fine. Now, the call to lpr, either via " system" or from the shell prompt, has to identify the target printer explicitly or no-go. That' s not a major problem except for the fact that it' s not obvious how to identify the default printer queue programatically. Tested on an XP Pro machine with similar results. When an application is being deployed to potentially hundreds of desktops, hand-setting the environment variables for each one is a non-starter. Any bright ideas?
Post #: 1
RE: Locating Default W2K or XP Pro Printer - Jul. 26, '03, 10:23:59 PM   
markfunk

 

Posts: 670
Joined: Mar. 31, '03,
Status: online
There might be a way via Windows WMI and using a Windows script to get the default printer information.

There are also the Win32 api' s GetDefaultPrinter() and EnumPrinters() which in combination should be able to give you the information you need for the -S and -P options to lpr.exe.

(in reply to Dan)
Post #: 2
Page:   [1]
All Forums >> [Windows - UNIX Interop] >> System & Network Admin Forum >> Locating Default W2K or XP Pro Printer Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.031