Hi,I am new to VBScript, I am trying to get all the printers status on a network. Is there a script to do that? thank youRead more
You can use Counter if you want to do multiple count of the list from collections import Counter list = ['Jones','Adams','Frank','John','Lopez','Jones','Smith','Ivan','Julian','Carlos','Adams','Frank','Jones','John','Ivan'] print(Counter(list)) Result: Counter({'Jones': 3, 'Adams': 2, 'Frank': 2, 'JRead more
You can use Counter if you want to do multiple count of the list
[crayon-67640cf479266773140589/]
Result:
[crayon-67640cf479269818295221/]
here is the code if you need to check if a printer is connected to nework: Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Printer WHERE Name = 'HP DeskJet 2720E'") For Each objItem in colItems If objItem.Network = True Then WScripRead more
here is the code if you need to check if a printer is connected to nework:
[crayon-67640cf478e9b233336126/]
This script uses the Windows Management Instrumentation (WMI) service to query for printers with the name “HP DeskJet”. It then checks the value of the
Network
property for each printer to determine whether it is connected to the network. If theNetwork
property isTrue
, the script outputs a message indicating that the printer is connected to the network. If theNetwork
property isFalse
, the script outputs a message indicating that the printer is not connected to the network.I hope this helps!
See less