Actually we plan to optimize our VBS logon script (unfortunately my VBS skills are not the best).
There is a row, in which we start an external application to set the customer's default printer (setdefaultprinter.exe). It is a simple program, which lets the user choose his favourite printer.
Some users do not have a printer or only one. The program "setdefaultprinter.exe" should only start if the users has two or more printer mapped.
Something like that:
If "2 or more printers are available" run setdefaultprinter.exe
else do nothing.
Based on some internet research I found the following script:
printerExists = False
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter In colPrinters
If objPrinter.Name = str Then
printerExists = True
But how can I combine it with my "IF condition"?
Thanks for any help