call an . exe in Java or html

Asked

Viewed 1,182 times

3

I am migrating a desktop system to web , with we have already largely ready, I would like to climb it and call what is not ready of the application by the browser , I would like a help, in the following question what the best way to do this, using angular, pure javascript, html?

  • Javascript does not have direct disk access or system properties, except for Node.js.

  • has some way to make a web service application open an application on desktop?

  • What you could do is a back-end application (Node.js, java, spring, etc.) with an end-point that when consumed runs yours. exe, and consume that end-point of your web application.

  • 1

    Search for URI Handler in the language used on your desktop system to know how to register type Urls suaAplicacao:\\dados.

2 answers

3


You can implement a Handler URI.

Create a . REG file to be executed, with the appropriate permissions, on Windows machines, with content similar to this:

REGEDIT4

[HKEY_CLASSES_ROOT\SuaAplicacao]
@="URL:Protocolo SuaAplicacao"
"SuaAplicacaoHandler"=""

[HKEY_CLASSES_ROOT\SuaAplicacao\DefaultIcon]
@="\"C:\\Program Files\\SuaAplicacao\\SuaAplicacao.exe\""

[HKEY_CLASSES_ROOT\SuaAplicacao\shell]

[HKEY_CLASSES_ROOT\SuaAplicacao\shell\open]

[HKEY_CLASSES_ROOT\SuaAplicacao\shell\open\command]
@="\"C:\\Program Files\\SuaAplicacao\\SuaAplicacao.exe\" \"%1\" \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\""

After that, use Urls in the following format:

SuaAplicacaoHandler://qualquerDadoQueDesejarPassar

for your Windows application to be invoked, and the parameter qualquerDadoQueDesejarPassar received by the application.

  • valeu Onosendai

  • @Aderbal not so, it is always a pleasure to help. =)

0

Cannot run files executable by browser. For security reasons. Since much of the work has already been done in your desktop application. It is advised to implement the concepts of flags in the desktop application (passing parameters) and then consume this with some scripting functions to make resources and processing available through a REST API. So you can use in your web application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.