One line JS fix fast shut down the machine

Source: Internet
Author: User

first , create a new file in the local JS file

JS Code:

(New ActiveXObject ("Shell.Application")). Shutdownwindows ();

two . Set shortcut keys

Set the above JS file to a shortcut key to the desktop, and then click on the file properties settings shortcut, you can use any and other shortcut keys different key combinations. Such as:

Third, the effect

When you press the shortcut key that you set on the desktop, such as pressing CTRL, ALT, and left at the same time, the effect is as follows:

Press ENTER to quickly shut down the computer.

Iv. Summary

The Axtivexobject object in JS is enabled and returns a reference to the Automation object, using the method:

var newObj = new ActiveXObject (servername.typename[, location])

Parameter (variable description):

Where newobj is a required option. The name of the variable to assign the value to ActiveXObject.

ServerName is a mandatory option. The name of the application that provided the object.

TypeName is a mandatory option. The type or class of the object to be created.

Location is an option. The name of the network server that created the object.

The Automation server provides at least one class of objects, such as a word processing application that may provide application objects, document objects, and toolbar objects.

The demo is a shell script program that enables the computer through ActiveXObject and executes the shutdown command .

One line JS fix fast shut down the machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.