I have an app that changes the default printer to a specific printer, prints, then changes the default printer back to it’s original printer.
Using the following to get the default printer
dim MyShell As new shell
Myshell.execute “wmic printer where default=‘TRUE’ get name”
tmpLine = Myshell.Result
And using the following to change the default printer
dim myShell as new shell
myShell.Execute “wmic printer where name=’”+NewPrinter+"’ call setdefaultprinter"
All of this works very well on an individual PC, however when trying it on a Network that is rather slow, I get a timeout error on getting the default printer and I have to pause the program for a few seconds to make sure that the default printer is changed before printing?
Does anyone know how I can 1.make sure that I can get the default printer without a timeout?
and 2. Make sure that the default printer has been changed before I print?