I'm trying to open video player in windows 7 with PHP but can't seem to make it happen. The only way it works is in background - I can hear the sound and it's in the process list but I can't see the video player itself. It's not listed in taskbar or in notification area.
I've tried with exec command and with COM class using WScript.Shell. I even tried with start in front of the command line but still nothing. If I use the same line in cmd.exe, it works, player pops up and starts playing but with php, it starts in background or doesn't start at all.
Code I use is following:
exec('start "C:\Program Files\Daum\PotPlayer\PotPlayer.exe" "D:\mov.avi"');
and
`$w = new COM("WScript.Shell"); $o = $w->Run('"C:\Program Files\Daum\PotPlayer\PotPlayer.exe" "D:\mov.avi"', 1, false);
--Edit--
This happens to me all the time - just after you've searched for long time and lost all hope you post your question. In next 10 minutes you lay back and just browse and you find answer to the question.
Anyway, I got this to work.Run -> services.msc
find apache server service and choose properties. Log on tab and check 'allow service to interact with desktop'. Restart apache and last script works. Windows will ask if you want to view the message, just click yes and video starts to play. Before you click return to desktop, be sure to close the video player window, otherwise it will stay playing and you have to stop it from task manager.
`