Question Locked

calling exe on client

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi All
I am trying to call an exe resides in my mobile client and wants to execute that exe file using javasctipt
i used the following code. but its not doing anything could anyone please tell me or other ideas.

funtion doScript()
{
var ws = new ActiveXObject("WScritp.Shell");
ws.run("file://my.exe");
}

Could any one please suggest other ideas.

thanks in advance,
Aruna

8 replies

by davidaaa2

What mobile client are you using. The code you use is ActiveX which straight away makes me think it will only work in IE and as far as I know Pocket IE on windows Mobile does not support most javascript if any.

What is the mobile device OS/browser? If not running in a browser how are you executing the code?

Is this something you are planning to deploy to other users or are you just running this for yourself? what handset are you running this on?

by arunagulla

David, I am using Mobile IE only. My MobileIE could disply Javascript alerts but when I try to use ActiveXobject() in JavaScript my MobileIE is not responding with any error msg. I am planning to deploy to other users but mainly to the same Mobile (qtek 9100 Pocket PC).

by bizzo

I'm not that hot on Javascript, but you could try giving the full pathname for the file you want to run:

ws.run("file:///c:/files/my.exe");

by arunagulla

Hi Bizzo,
thank you very much for your replies, I have used exact path but stilll have the same
problem. you can check my exact path here:

var wshell = new ActiveXObject("WScript.shell");
wshell.run("file:///Storage Card/Programme/HNMobileCab/Offline_MobileContent.exe");

by bizzo

Two things you could try, as I think the space in "Storage card" could be causing the problem. Either replace the space with %20 or surround the string with quotes '\"'. eg.

wshell.run("file:///Storage%20Card/Programme/HNMobileCab/Offline_MobileContent.exe");

or

wshell.run("\"file:///Storage Card/Programme/HNMobileCab/Offline_MobileContent.exe\"");

I think either of these may work.

by arunagulla

I tried the both ways but no change. I could not understand whether its the problem of my path or ActiveX suppport on PocketPC.

by arunagulla

Hi
I have tried to call an html page located in the same path and worked well but its not calling the exe file. Any Ideas please.
I have tried with "document.location.href".

This discussion is closed to new replies.