Js calls local programs and js calls

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.