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}");
WScript 对记事本的操作
最新推荐文章于 2023-10-05 10:57:41 发布
本文介绍了一段使用WScript.Shell对象的VBScript代码,该代码能够自动启动记事本,输入文本“HelloWorld!”并保存到指定路径。通过此示例,读者可以了解如何利用WScript.Shell对象进行简单的自动化操作。
1077

被折叠的 条评论
为什么被折叠?



