HI Tracy,
If you mean from within VFP, I'm not sure...I'm assuming you mean with
SET('PRINTER',2) and ,3). To do so I could knock a small utility
together to run on an affected workstation, but when one of the
workstations 'breaks' I'm under a lot of pressure to just make things
work again, even if it's just a reboot. Unfortunately i don't have this
problem on my development system and can't simulate it, other than
deleting registry entries (which as I explain below, don't seem to
really be the source that VFP relies on.)
Meanwhile, I can and have checked the default Windows printer setting
using WMIC and CSCRIPT at the command line (see below).
To make things more fuzzy, I've found at least four potential Registry
values that might be involved in specifying the default printer...and
I'm not sure which one VFP considers the "proper source."
For example, today I got several errors from a workstation that has had
issues in the past week.
First up, I checked the default printer setting on the workstation using
the command lines...
cscript
C:\windows\system32\Printing_Admin_Scripts\en-US\prnmngr.vbs -g
(returned false)
and
wmic printer get name,default (returned blank, no default)
Next I looked in the "Devices and Printers" Windows dialogue, it showed
no printer "green checkmark" as default.
So, I'm thinking hey! I'm on it!
Finally, checked the registry entry at
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
for "Device"
and it was blank. Alright! this is what I was looking for!
Fired up my VFP app and tried to print, and threw an error. Good!
Now it gets weird.
Used WMIC to set the default printer using
wmic printer where name='printername' call setdefaultprinter
(changing printername to the right name, of course.)
1. Tried to print from VFP app, works, no errors. Prints fine.
2. Ran the above command line scripts to check for default, got False
and blank. Rats.
3. Confirmed the default green checkmark was set in the Devices and
Printers dialogue on the right device. Good.
3. Checked the above registry entry, still blank. Did some registry
searches and did find a few other entries that were set to the
appropriate device, so, that registry entry is obviously not the
registry entry to deal with for VFP. What's more, I'm now out of ways
(other than a different registry entry of which I know of 4 so far under
HKEY_CURRENT_USER and HKEY_USERS) to determine if the default is set or
not.
I'm not really interested in developing an all-inclusive printer
management system, unfortunately.
Mostly I would really like to stop whatever started this as I've never
had it before in over 20 years. SOMETHING is causing the default printer
in Windows to be boinked...just not seeing any potential sources.
Again, all input appreciated! Thanks for the question!
Mike C
Tracy Pearson wrote:
Does finding out what the default printer if is cause an error? If it is
different then the stored value, the system can be self updating. If it is
blank, or an unknown device, it can make adjustments.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.