Код:
set shell = WScript.CreateObject("WScript.Shell")
timeout = 10
title = "UNTITLED - NOTEPAD"
Do
If shell.AppActivate(title) Then
shell.sendkeys("{ESC}")
WScript.Quit
End if
if timeout = 0 then exit do
WScript.Sleep 1000
timeout = timeout - 1
Loop
WScript.Echo "NET"