The Windows Script Host (Windows Script Host) provides a language-independent Script Host For the ActiveX Script engine. It allows you to run scripts on Windows desktops or through command lines. It is convenient to do batch processing.
[Play a game] Save the following code as sendkeys. js and double-click it to run it.
The Code is 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 does not involve much content. If you have a good foundation, you can master it within 40 minutes (that is, browsing the tutorial again ).
Here is a Chinese tutorial, is left by the elders of autumn: http://www.blueidea.com/user/qswh/WSH.CHM
This tutorial is old and new information is visible in http://msdn.microsoft.com/library/en-us/script56/html/d78573b7-fc96-410b-8fd0-3e84bd7d470f.asp
The rest is to call the ActiveX components you need, which is also the main pleasure of Windows Scripting. One of the reasons that makes ActiveX technology obsolete is its application in scripts.
In addition to direct script applications, WSH can also be embedded into other programs. The Delphi and VB (6.0) programs use regular expressions in this way.