// Example #1:
// Insert copyright notice at the top of a file,
// and save the file with the change
var oShell = WScript.CreateObject("WScript.Shell");
oShell.AppActivate("Notepad"); // Set focus to program
WScript.Sleep(100); // Delay for a bit
oShell.SendKeys("^{HOME}"); // Cursor to top of file
WScript.Sleep(100); // Delay for a bit
oShell.SendKeys("// Copyright {(}c{)} 2010, MyCompany");
WScript.Sleep(100);
oShell.SendKeys("{Enter}"); // line break
WScript.Sleep(100);
oShell.SendKeys("^s"); // Ctrl+S saves the file
WScript.Echo( "done!" );