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-675df7ac1360e838740396/]
Result:
[crayon-675df7ac13613525693932/]
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-675df7ac1316c202218231/]
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