To run an external application, use the Run Method of WshShell Object.
The following example code runs the Windows calculator and sends it keystrokes to execute a simple calculation 1+2=.
WshShell = new ActiveXObject( "WScript.Shell" );
WshShell.Run( "calc.exe" );
Sleep( 1000 );
wnd = shell.FindWindow( "", "Calculator" );
wnd.SetForeground();
shell.SendKeys( "1" );
Sleep( 100 );
shell.SendKeys( "{+}" );
Sleep( 100 );
shell.SendKeys( "2" );
Sleep( 100 );
shell.SendKeys( "=" );
Set WshShell = CreateObject( "WScript.Shell" )
WshShell.Run "calc.exe"
Sleep 1000
wnd = shell.FindWindow( "", "Calculator" )
wnd.SetForeground
shell.SendKeys "1"
Sleep 100
shell.SendKeys "{+}"
Sleep 100
shell.SendKeys "2"
Sleep 100
shell.SendKeys "="
Microsoft MSDN Library: Run Method
Send feedback on this topic to Emurasoft