what i'm trying is to make kmplayer open this video. but seems like it wants to output it at the browser. how can i make it open kmplayer at my screen?
Does running that code on your command line open the executable? Also, I assume that you are attempting to run this on your local machine web server right? It's useless to even attempt that on a remote server which likely wouldn't have that KMPlayer installed (and has a higher probability of being a linux machine anyway).
Hm.. I want to control my laptop using my computer. Another thing is that my laptop is far and connected into a tv so i wanted to watch some videos there while i use the pc.
Not using PHP as a web environment I don't. Running exec in a PHP script executes a command on the server, not on the client using it. That would be a tremendous security hole if it were possible to do.
For that I'd suggest writing something in either Java or C#/VB.NET. Both should be fairly easy to set up, and on the same network you can set up the user as administrator on both machines.
Also, as for the exec not working properly, this has to do with piping the output. Effectively trying to call a command is waiting for the command to return the output, and since some commands don't (such as trying to launch notepad), than it will just sit there running infinitely in the browser. Windows in particular is an absolute pain for exec.
I was actually thinking about that but i got an issue. I thought about accessing my laptop's cmd and open the file from there but i couldn't maximize it. How can i send data to kmplayer (like keyboard keys)? Can it be done from cmd or i have to use Java?
You'd need to check your documentation. Typically if you are launching an application from command line, you'll need to provide it with all of the arguments it requires. PHP would be limited to trying to interact with the process itself (using proc family may be able to help with that). If there is a way for it to be done from the command line calls, than sure you can do that. Maximum and fullscreen options for video players can *likely* be performed at the command line call. If they have it in, you can try launching the executable with the /? on it which typically brings up the help menu in windows to show you what arguments it will accept.
Java can make use of the Robot class which allows you to click on the screen. I've never tried to set up a client / server application which uses the robot before, but I'd presume you can issue commands remotely that would interact with the Robot. Positioning is where the pain will be.
Is there any reason why you don't simply use remote desktop to control it instead? Sounds like it would be a lot easier than writing something to do it.
Actually i could send just an "Enter" key to KMPlayer to maximize it. I'm aware of those remote desktops but it takes a lot of time by typing computer's id and pwd (team viewer). So i'd like to use something fast that could not take a lot of the core's processor.