# Runnig a .exe on clients

Through a PHP page, how can we execute a binary (.exe) on a client runnig windows?
Windows filesystem object looks good but it only manipulates text files.

You mean there's no Activex or Java applet which be able to execute a binary file?

I don't know if you can, but it doesn't seem like a good idea.. potential security risk!

Omid said:
Through a PHP page, how can we execute a binary (.exe) on a client runnig windows?
Windows filesystem object looks good but it only manipulates text files.

I dont think you can run any old exe, that would impose a secuirty risk we cant not even begin to imagine. But Java does classify its code in security segments. You can run scripts, java apps, and if you allow, ActiveX controls. All of which (ecxept the scripts) are binary files. Is this what you were refering too?

We have a web based accounting system which is on a server in the Internet. Our clients are connected to that server via Internet.
Sometimes we need to launch a utility, like the scanner manager, for the user. i.e when the user pushes "Scan" botton in our page in MS internet explorer we want to launch "scan.exe" for the user on his machin.
Windows scripting Host has so many good functions for manipulating files but they just handle .txt files. What shall we do? Ask the user to launch the scan.exe by double clicking on it? That looks fairly good but my boss wants me not to bother the users :((

dduardo
Staff Emeritus
I think your are over-developing this accounting system. Let the person use whatever scanning program they want to use to scan local images. Then just have a simple upload form to get the file on the server. If I was to develop this system I would avoid executing remote programs because that could easily turn into a security risk. Your also limiting what browser the person can use.

robphy
Homework Helper
Gold Member
This is probably NOT a good idea... but I think
on a webpage, this will launch notepad on the client machine running Windows. (Of course, the path must be known ahead of time.)
Code:
<a href="file:///D:/WINNT/system32/notepad.exe">notepad</a>
As dduardo has repeately said, this is a security risk. Imagine all of the virii and spyware that could invade the client (especially if the client is tricked into executing something).

As eNathan suggested, you could try to write something in java. Read the section called "Remote scanning" from http://www.programmersheaven.com/2/Java-Twain-image-acquisition .
http://www.gnome.sk/Twain/tutorial/remote.html [Broken]
Since your application appears to be for commercial purposes, you need to check if you can include this in your package.