ITeye博客

WScript 对记事本的操作

tof.j · 2008-10-18 12:52 · Markdown

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("{Enter}");
WshShell.SendKeys("%{F4}");

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。