469,334 Members | 4,335 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,334 developers. It's quick & easy.

how can i launch an application using javascript

hi everyone,

im fairly new to javascript so here goes: Im building an application that requires a database (i'm using wampserver) and i want to create a desktop icon which is a shortcut to the login page for the program. When the user double clicks the shortcut on the desktop, i want to automatically launch the wamp server. Ive done a little research and google has told me this is possible but only using ActiveX. Firefox may block the application...
The thing is, im following code samples from google and it is not working; maybe i'm doing something wrong?
or maybe what i want to do is not possible?

(for simplicity, i've included my javascript code in my html code)

this is what i'm doing:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <head>
  3.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4.         <link rel="stylesheet" title="loginPage" type="text/css" href="loginPage.css" /> 
  5.  
  6. <script Language="JScript">
  7.     function runcmd() {
  8.         File="C:\Program Files\Wamp Server\wampmanager.exe";
  9.         WSH=new ActiveXObject("WScript.Shell");
  10.         WSH.run(File);
  11.     }
  12. </script>     
  13.  
  14.         <title>Test page</title>
  15.  
  16.  
  17.     </head>
  18.  
  19.  
  20.  
  21.     <body onLoad="javascript:runcmd();"> 
  22.                 <div id="login">
  23.                 <form action="userLogin.php" method="post" enctype="multipart/form-data" name="userLoginInfo">
  24.                        <label>Login: </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  25.                     <input name="userName" type="text" size="15" maxlength="10" />
  26.  
  27.                     <br />
  28.  
  29.                     <label>Password: </label>
  30.                     <input name="password" type="password" size="15" maxlength="10" />
  31.  
  32.                     <br />
  33.  
  34.                     <input name="loginButton" type="button" value="Login" />
  35.  
  36.                 </form>
  37.  
  38.                 </div>
  39.  
  40.  
  41.     </body>
  42.  
  43. </html>
  44.  
  45.  
  46.  



any guidance will be appreciated :)
thx
Sep 8 '10 #1
3 2433
Dormilich
8,651 Expert Mod 8TB
that approach won’t work in any other browser than IE. in general, JavaScript has no access to the client’s file system (a security measure).

is your application a web application or a desktop application?
Sep 8 '10 #2
im trying to create a web application. For now though, it will run on the local server but eventually i would like to get a domain name and host server :)

thanks again
Sep 8 '10 #3
Dormilich
8,651 Expert Mod 8TB
if it should run on a host server eventually, there’s no problem. in that case the DB/webserver will run all the time. even if you have a local test server, just make sure all required services (i.e. webserver & DB server) are started on booting.
Sep 8 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by A.A. Fussy | last post: by
1 post views Thread by Konrad | last post: by
1 post views Thread by Leonid Finis | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.