ASP JScript for Rebooting a computer remotely





1
Date Submitted Fri. Jan. 22nd, 2010 2:56 AM
Revision 1 of 1
Scripter Cloudgen
Tags ASP | JScript | Reboot | Remote-Reboot
Comments 0 comments
This ASP Jscript can be used to reboot a computer remotely. However, the file security of the page should be set to have sufficient right in IIS.
Details can be found: Remote Reboot JScript

<script language="JScript" runat="server">
var objWMIService=GetObject(
  "winmgmts:{(Shutdown)}\\\\.\\root\\cimv2"
);
var colItems=objWMIService.ExecQuery(
  "Select * from Win32_OperatingSystem"
);
var items = new Enumerator(colItems);
while (!items.atEnd()){
  items.item().Win32Shutdown(6);
  exit;
}
</script>

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Scripter Cloudgen

Votes Down