Skip to content

Instantly share code, notes, and snippets.

@jat001
Last active June 30, 2021 05:26
Show Gist options
  • Save jat001/6bf3a02693fa180c8852 to your computer and use it in GitHub Desktop.
Save jat001/6bf3a02693fa180c8852 to your computer and use it in GitHub Desktop.
Set Processes = GetObject("winmgmts:").InstancesOf("Win32_Process")
intProcessId = ""
For Each Process In Processes
If StrComp(Process.Name, "Wow-64.exe", vbTextCompare) = 0 Then
intProcessId = Process.ProcessId
Exit For
End If
Next
If Len(intProcessId) > 0 Then
set WshShell = CreateObject("WScript.Shell")
While True
WshShell.AppActivate intProcessId
WshShell.SendKeys " "
WshShell.SendKeys "%{ESC}"
WScript.Sleep Int((240000 - 60000) * Rnd + 60000)
Wend
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment