Set wmi=GetObject("winmgmts:\\.\root\cimv2") Set list=wmi.ExecQuery("select * from win32_operatingsystem") For Each uu In list uu.win32shutdown(1+4) next