Search the Community
Showing results for tags 'online'.
-
This is a very simple sample about checking printer status and set its online/offline status.may help those who in need of this issue. $StrComputer="." $obj=ObjGet("winmgmts:\\"&$StrComputer&"\root\CIMV2") $colitems=$obj.ExecQuery("Select * from Win32_Printer") For $objitem In $colitems If $objitem.Caption=="SHARP AR-1808S" Then $a=Int($objitem.Attributes / 1024) If Mod($a, 2)=0 Then MsgBox(0,0,"Printer is online",8) ElseIf Mod($a, 2)=1 Then MsgBox(0,0,"Printer is offline,press 'OK'button To make the printer online ",8) ;core code $objitem.WorkOffline = False $objitem.Put_ ;~~~~~~~~~~~~~~~~~~~~~~ MsgBox(0,'','Printer is online now.') Else MsgBox(0,0,"unknown status",8) EndIf EndIf next
-