Js calls local programs and js calls
A few days ago, when I was working on a project, I used js to call a local program and found a lot of information. One was to write the registry, and the other was to write a browser plug-in. Relatively speaking, it is easier to write a registry because the requirement is tight. The following is my summary. I hope it will be helpful to you. I forgot where to find it. I would be very grateful if I have been tired of seeing it.
Step 1:
Write to registry, registry example
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\openNotepad] @="URL:openNotepad Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\openNotepad\DefaultIcon] @="TestKZT.exe,1" [HKEY_CLASSES_ROOT\openNotepad\shell] [HKEY_CLASSES_ROOT\openNotepad\shell\open] [HKEY_CLASSES_ROOT\openNotepad\shell\open\command] @="cmd /c set m=%1 & call set m=%%m:openNotepad:=%% & call \"C:\\Windows\\TestKZT.exe\" %%m%% & exit"
Save as 1.reg.
Step 2: Use a browser to call and input parameters, for example
<! Doctype html public "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
You can call an external program.
Other notes:
The example calls a user-defined program C: \ Windows \ TestKZT.exe. The input parameters are similar.
There is no need for a small example. If necessary, leave a mailbox.