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