I wanted to change the tile icons for desktop applications in the new Windows 8 launch menu. In this way, they will fit into other metro applications.
I made a simple metro application that calls a simple php file localhost
<?php // check if the chrome is in the task list exec('tasklist /FI "IMAGENAME eq chrome.exe" 2>NUL | find /I /N "chrome.exe">NUL'); // get a return value I can check $runing = exec('if "%ERRORLEVEL%"=="0" echo Programm is running'); if ($runing === 'Programm is running'){ // the program is open already echo $runing; } else { // the program is not running and should be opened exec('C:\Users\Gerdy\AppData\Local\Google\Chrome\Application\chrome.exe'); } ?>
If I run this file with chrome, its echo is "The program is running."
It's great!
If I started it from Windows startup and Chrome is not running, Chrome does not start.
If I exclude the if statement and just run.
exec('C:\Users\Gerdy\AppData\Local\Google\Chrome\Application\chrome.exe');
On the Start menu. It will open a new Chrome window regardless of whether chrome is open.
So, I think, my question is: What can I do to let my php file check if chrome is open, and if not, open it?
This model actually works for any other program, not browsers.
My best guess is that he does less with my teams and is more connected with chrome itself. This may be the goal I need to add, I do not know.
Chris source share