The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024

Latest message you have seen: Re: Re: Robots


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X10 - shutting down a PC ?




Here's a nifty little vbscript script you can use (it works on NT but not
tried it on XP)

Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8
strComputer="computernamehere"
wmiPath = "winmgmts:{(RemoteShutdown)}!//" & strComputer
& "/root/cimv2"
Set wmi = GetObject(wmiPath)
set objOSset = wmi.instancesof("win32_operatingsystem")
nOptions = EWX_LOGOFF + EWX_FORCE + EWX_SHUTDOWN+EWXPOWEROFF
for each objOS in objOSset
objOS.win32shutdown nOptions
next


S.



___________________________________________________________________________
The information contained in this message is confidential and may be
legally privileged. If you are not the intended recipient, please do not
read, copy or otherwise use it and do not disclose it to anyone else.
Please notify the sender of the delivery error and then delete the
message from your system.
Any views or opinions expressed in this email are those of the author only.
Communications will be monitored regularly to improve our service and for
security and regulatory purposes.
Thank you for your assistance.
___________________________________________________________________________



Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.