[wpkg-users] Testing is a specific process is running

David Petterson david at ifm.liu.se
Fri May 20 10:20:50 CEST 2011


You can use a script instead:
(Like this one I got from a colleague)

=== wait_for.cmd ===
@ECHO OFF
:Loop
ping -n 5 127.0.0.1 >NUL
tasklist.exe /FI "IMAGENAME eq %1" 2>NUL | find.exe "PID" >NUL || GOTO
Continue
GOTO Loop
:Continue
===

Call the script with the exe you wait for:  wait_for.cmd firefox.exe

/David

David Petterson <david at ifm.liu.se>		Phone: +46(0)13-28 2617
Systems Administrator
Department of Physics, Chemistry and Biology at Linköping University
Office: F F202
SE 581 83 Linköping, Sweden


On 2011-05-20 10:09, LAPLAUD François wrote:
> Hi again for another question...
>
>  
>
> I would like to install a package only if a specific process is not running.
>
> I read http://wpkg.org/Script_for_checking_if_a_process_is_already_running but it is explained for win2000 OS.
>
>  
>
> I want to try it on XP and Seven.
>
>  
>
> I tried to add this line in my package.xml file.
>
>  
>
> <install cmd='%COMSPEC% /c %SystemRoot%\system32\tasklist.exe /FI "IMAGENAME eq firefox.exe" 2>NUL | %SystemRoot%\system32\find.exe /I /N "firefox.exe" >NUL'/>
>
>  
>
> But it always return 1
>
> This command line works in a shell but not in wpkg. Does anyone of you have an idea of what is wrong ? (maybe the pipe is not possible, nor the redirection (>) ?
>
>  
>
> Thanks
>
> Laplaud François
>
> Service Informatique & Transmission
>
> Service Départemental d'Incendie et de Secours de la Sarthe
>
> 13, Boulevard Saint Michel
>
> 72190 Coulaines BP 35
>
> Tel : 02.43.54.66.06
>
> Fax: 02.43.74.37.61
>
> P Je pense ENVIRONNEMENT: ai-je vraiment besoin d'imprimer ce message ?
>
>  
>
>
>
>
> -------------------------------------------------------------------------
> wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
> _______________________________________________
> wpkg-users mailing list
> wpkg-users at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/wpkg-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20110520/35e82f2b/attachment-0002.html>


More information about the wpkg-users mailing list