Im currently making a webpage for my thesis.. its in HTML and on localhost, the system should be able to view a profile of the client and also do a task the should be able to open an application on the client's computer.. im running the webpage on wamp..

can you please suggest some ideas to solve this problem.. thanks in advance.. :)

Dani AI

Generated

Short summary for : a regular web page cannot silently launch an arbitrary .exe on a visitor’s PC — modern browsers and OSes require a locally installed component and explicit user approval. That constraint is why and were correct about security and server-vs-client behaviour; you need a client-side helper to actually run code on the client. (web.dev)

Practical option 1 — register a custom URI scheme (deep link). Ship a small native app that registers a protocol (for example myapp://…). Put a simple link on the page like:

<a href="myapp://open?id=123">Open desktop app</a>

When the user clicks it the OS will launch your app and pass the URL. This is simple and cross-platform (Windows via registry entries, macOS via Info.plist), but requires the user to install the app first and you must validate inputs inside the native app. (learn.microsoft.com)

Practical option 2 — browser extension + native messaging. Build a WebExtension that your users install and pair it with a small native host (manifest installed on the machine). The extension uses the browser’s native-messaging API to start the helper and exchange JSON messages; this is the cleanest programmatic approach because the user explicitly installed both pieces. It is more work to package and deploy, but it avoids hacks and is supported by Chrome and Firefox. (developer.chrome.com)

Other paths & cautions: on Windows you can use ClickOnce for .NET apps (web links launch a signed deployment), but browser behaviour varies; legacy plugin/ActiveX/NPAPI approaches are deprecated and insecure and should be avoided. If you control an intranet, an installed helper that listens on localhost (with CORS/CSRF protections) is another pattern — still requires an installed program. For production, prefer a signed installer + protocol handler or native-messaging extension, and expect OS/browser prompts and the need to sign manifests/installers for trust. (learn.microsoft.com)

Recommended Answers

All 5 Replies

Browsers won't allow you to do this, because of security issues.

commented: They will offer to let you download the files, though. +4

Is there a way to execute an .exe file from a web page in stead of downloading it? The link to the .exe just brings up the download window and I have not been able to figure out how to make it run/execute in stead of download.

Any sugestions will be greatly appreciated!! Thanks!!

No, you can't.

even if it were possible, it would run on the server where you have your exe stored, not on the client where you want the exe to be executed.

Point the link to a .bat file and run the program from there. You'll still get the pop-up asking the user's permition (this is a security issue) before it executes. Some browsers don't allow it; Opera does.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.