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

Jerold Schulman

August 13, 2006

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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 Offif {%1}=={} @echo Syntax: ActivatePID PID&goto :EOFif 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":doitcscript //nologo "%TEMP%ActivatePID.vbs" %1


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like