Any and all,

Here's the scenario:
Problem: VFP 9 SP2 throws random errors "#1958 Error loading printer driver"
Platform: Windows 7 Pro (x 150 workstations)
Printers: 99% Lexmark, various models, a couple HP for good measure (none of the HP have been involved, yet)
Known trigger: the code line in my app "set printer to default"
Known fix: Manually reset the default printer in Windows 7

My application was last updated in December of 2014. Since then, no changes.
Prior to last Saturday, no problems of this type.

Literally, "suddenly" last Saturday morning, 10/3/15, I began receiving 5 or 6 error reports per hour (my app emails me when it has an error) from various locations (there are three physical buildings in three cities running the same app.) All the errors were the same "Error loading printer driver". The error is thrown when you try to print and the line "set printer to default" is encountered. After the error, nothing is printed. No error, prints fine.

It's not the data source: printing from ANY source (including not my application) throws a printing error of some sort.

"The fix":
Rebooting always works...but I'm not a fan of this nuclear option, and the problem has recurred on the same machine multiple times per day. Kind of a work-killer to want to print a sales order for a waiting customer and have to reboot first. I discovered that manually setting the default printer in the Win7 "Devices and Printers" dialog fixes the problem. I also found a WScript code snippet that will set the default printer, as long as you know the printer's name.

"The obstacle":
I can't find a way to "un-set" the default printer in Win7 Pro for trouble-shooting and code testing. Setting the default printer...no problem...lots of solutions including code strings and utilities. But to test my "fix" I need to be able to remove the default printer selection/setting in Windows and after an hour of Googling, no luck finding a way, whether by VFP or WScript or any other way in Windows.

Obviously something is removing the default printer setting.
So far only about 9 of the 150 systems have had this happen, but each day is like Whack-a-Mole...a new system that hasn't done this before will start throwing errors. When that happens I check the system, "no default printer" is set, so I set it manually and the errors go away.

All the computers are cookie-cutter systems I built using the same hardware/software. None of them allow the user to install software or printers without an admin password that only I and the owner of the business has. The hardware/software is as homogenous as possible...personalization is frowned on and discouraged.

After finding a post from a few years ago on this list from Matt, I had hopes that reinstalling the printer drivers would help. And it does, for a while (because installing a printer driver sets the default printer) but one workstation in particular has had two different printer drivers installed, then subsequently lost the "default printer setting" and resumed throwing errors.

My best solution so far:
When the 1958 error is trapped in my error routine, I can get a list of installed printers to present in a popup for selection by the user, then set that printer as the default....then print. That's doable, but I'd like to bypass it.

Ideas already shot down as unacceptable by the end users:
ALWAYS prompt them to pick the printer. Oh no no no...
The workstations are physically arranged in clusters so that 3 to 6 workstations share a common, networked printer. ALL printers are networked, none are physically connected to the workstation. The users never want to print from "Workstation 12" to "Printer 5" which is physically distant because that would require walking when they don't want to walk.

Any other ideas? Sorry this is long, but this is the results after a week of research and troubleshooting.

What I would like to find out:
How to "unset" the default printer setting in Win7 Pro.
How to best automate the fix for the 1958 error so that the end user is not forced to pick the default printer every time? I can store the default printer name on that workstation (like in an INI file) and "if file('printerdefault.ini')" read the setting and set it...
All of this is hard to do when I can't reproduce the error!

Thanks VERY much for any input! I also am posting this in the hopes that someone else benefits from my troubleshooting someday...

Mike Copeland

_______________________________________________
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.

Reply via email to