Windows Script Host (Windows Scripting Host) provides an ActiveX scripting engine with a language-independent script host. It allows scripts to run through the Windows Desktop or command line. It's convenient to do something that needs to be batched.
[Play a game] save the following code as Sendkeys.js, and then double-click to run it.
Copy Code code as follows:
var WshShell = new ActiveXObject ("Wscript.Shell");
Wshshell.run ("Notepad");
Wscript.Sleep (100);
Wshshell.appactivate ("Notepad");
Wscript.Sleep (100);
Wshshell.sendkeys ("Hello world!{ ENTER} ");
Wscript.Sleep (500);
Wshshell.sendkeys ("^s");
Wscript.Sleep (500);
Wshshell.sendkeys ("C:\\savedworld.txt");
Wscript.Sleep (500);
Wshshell.sendkeys ("%s");
WSH itself is not a lot of content, if you can be a good foundation in 40 minutes within the basic grasp (that is, the tutorial to browse through).
Here is a Chinese tutorial, is left by the eyes of the ancestors of the things: Http://www.blueidea.com/user/qswh/WSH.CHM
This tutorial is older, and the new data is visible in http://msdn.microsoft.com/library/en-us/script56/html/d78573b7-fc96-410b-8fd0-3e84bd7d470f.asp
All that's left is to call the ActiveX component you need, which is also the main fun of Windows scripting. One of the reasons why ActiveX technology is not obsolete is its application in scripting.
In addition to direct scripting applications, WSH can also be embedded in other programs, and Delphi and VB (6.0) programs use regular expressions in this way.