WScript 对记事本的操作

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}");

你可能感兴趣的:(C++,c,C#)