Re: Invoking PID in Task Manager



On Fri, 11 Aug 2006 02:15:01 -0700, davinci coding <davinci coding@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Is there a way to invoke the PID that exists in the Task Manager using batch
command?
or using Windows scripting that is to be included in the batch file.

ActivatePID YourPid

@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

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
.