Q. How can I give focus to a PID (ProcessID)?

If you parsed a task list and identified a PID you would like to give focus to, run ActivatePID.bat.

The syntax for using ActivatePID.bat is:

\[Call\] ActivatePID PID

Where PID is the Process ID you wish to activate.

ActivatePID.bat contains:

@echo Off
if \{%1\}==\{\} @echo Syntax: ActivatePID PID&goto :EOF
if exist "%TEMP%\ActivatePID.vbs" goto :doit
@echo dim  objArguments, pid>"%TEMP%\ActivatePID.vbs"
@echo Set WshShell = CreateObject("WScript.Shell")>>"%TEMP%\ActivatePID.vbs"
@echo Set objArguments = Wscript.Arguments>>"%TEMP%\ActivatePID.vbs"
@echo pid = objArguments(0)>>"%TEMP%\ActivatePID.vbs"
@echo WshShell.AppActivate pid>>"%TEMP%\ActivatePID.vbs"
:doit
cscript //nologo "%TEMP%\ActivatePID.vbs" %1


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish