Archive for the ‘Javascript’ Category

用 Javascript 控制记事本

星期一, 十一月 24th, 2008
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.AppActivate("notepad");
WshShell.Run("notepad", 1, false);
WScript.Sleep(500);
WScript.Sleep(300);
WshShell.SendKeys("1{+}");
WScript.Sleep(150);
WshShell.SendKeys("2");
WScript.Sleep(150);
WshShell.SendKeys("~");
WScript.Sleep(150);
WshShell.SendKeys("*3");
WScript.Sleep(150);
WshShell.SendKeys("~");
WScript.Sleep(250);