js调用可执行exe

  1. 注:
  2. 1、ie设置--降低安全级别如 Intenet选项——安全——自定义级别——对未标记的ActiveX控...————启用
  3. 2、路径中含空格
  4. a:用%20代替空格
  5. <html>      
    <head>      
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">      
    <title>js</title>     
      
    <script   language="JavaScript">  
       
      function   open_exe(shellp)  
      {  
    	  try      
    	  { 
    		  a=new   ActiveXObject("wscript.shell");  
    		  a.run(shellp);  
    	  }      
    	   catch(e)   
    	   {   
    	        alert('找不到文件"'+shellp+'"(或它的组件之一)。请确定路径和文件名是否正确.')      
    	   }      
      }  
       
     
      </script>       
         
    </head>    
    <body>
        
       <button   onclick="open_exe('file:///F:/2/1.exe')">打开1</button>  
      <button   onclick="open_exe('file:///C:/Program%20Files%20(x86)/QQ2013/Bin/QQ.exe')">打开QQ</button>
    
    </body>        
    </html>    
     
  6. b:如下解决思路(转自网络)
  7. <html>  
  8. <head>  
  9. <title>RTX</title>  
  10. <script>  
  11. function exec () {  
  12.   var command;  
  13.     var shell = new ActiveXObject("WScript.Shell");   
  14.     command = shell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Tencent\\RTXC\\INSTDIR");//从注册表获得软件安装路径  
  15.     command = command + "RTX.exe";  
  16.   window.oldOnError = window.onerror;  
  17.   window._command = command;  
  18.   window.onerror = function (err) {  
  19.     if (err.indexOf('utomation') != -1) {  
  20.       alert('命令' + window._command + ' 已经被用户禁止!');   
  21.       return true;  
  22.     }  
  23.     else return false;  
  24.   };  
  25.   var wsh = new ActiveXObject('WScript.Shell');  
  26.   if (wsh)  
  27.     wsh.Run("\""+command); //解决目录包含空格问题  
  28.   window.onerror = window.oldOnError;  
  29. }  
  30. </script>  
  31. </head>  
  32. <body>  
  33. <center><a href="javascript:" onclick="exec()">RTX测试</a></center>  
  34. </body>  
<tauri><JavaScript><GUI>基于tauri,实现JavaScript二进制程序侧载,进行TCP通讯 本文介绍了如何在Tauri框架中通过侧载(Sidecar)功能嵌入并运行外部二进制文件。首先需要将目标exe文件放置在src-tauri/binaries/目录下,并在tauri.conf.json中配置externalBin路径。随后通过JavaScript调用@tauri-apps/plugin-shell的Command.sidecar方法启动进程,同时需要配置shell插件的执行权限。文中提供了完整的代码示例和权限配置方法,最终实现的效果是:将Node.js开发的TCP服务器打包成exe后,成功集成 阅读详情

相关推荐

js前端浏览器打开本地exe程序的demo

功能:在web浏览器页面上有一个按钮,点击按钮,调起本地的.exe程序客户端。通过添加注册表的方式实现该功能。 能做到什么: 1. 打开各种应用:用户可以通过点击按钮来启动本地的.exe程序客户端,从而实现打开各种应用程序的功能。无论是游戏、办公软件还是其他类型的应用程序,都可以通过该功能进行快速启动。 2. 提高用户体验:通过将常用的应用程序集成到网页中,用户可以方便地在浏览器中直接打开所需的应用程序,无需繁琐的寻找和启动过程,提高了用户的使用体验。 3. 跨平台兼容性:由于该功能是基于浏览器实现的,因此可以在不同的操作系统和设备上使用,具有良好的跨平台兼容性。 4. 简化开发和维护:通过添加注册表的方式实现该功能,可以简化开发和维护工作。开发人员只需要编写相应的代码,将其部署到服务器上即可,无需对每个用户的计算机进行额外的配置。

s调用exe程序方法(通过URL Protocol实现网页调用本地应用程序)

1.使用记事本(或其他文本编辑器)创建一个protocal.reg文件,并写入以下内容 Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Webshell] @="URL:Webshell Protocol Handler" "URL Protocol"="" [HKEY_CLASSES_ROOT\Webshell\DefaultI...

技术积累 2375

JavaScript打开客户端exe文件的代码

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

js 调用本地 exe 方法(通用,支持目前 大部分主流浏览器,chrome,火狐,ie)...

js 调用 本地 exe 通用解决方法 前言 在web项目中,经常遇到需要在某个页面上需要调用本地的程序exe,网上有很多方法,大部分只能在ie上用 。 var path = '程序地址.exe 参数';//程序地址 +' '+ 参数; //exe程序所在位置以及要传的参数 try { var Shell = new ActiveXObject("WScript.Sh...

geekswg 2万+

Centos7.6操作系统安装+Bond配置(600GB磁盘版本)

1.安装前准备工作 准备centos7.6操作系统镜像 CentOS-7-x86_64-DVD-1810.iso 服务器安装一般都是在BMC界面操作,所以安装前需要在BMC界面挂载好操作系统镜像 重启服务器后自动进入安装界面。 华为大数据集群安装操作系统配置

小时光 6010

VBA一键汇总多个工作簿-名称相同的工作表-的指定区域数据

VBA一键汇总多个工作簿-名称相同的工作表-的指定区域数据 日常工作,我们经常需要汇总相同格式的工作簿的某个工作表的数据 如1月业绩、2月业绩。。。。12月业绩等 姓名 数量 数据22 22 数据23 23 数据24 24 数据25 25 数据26 26 数据27 27 数据28 28 数据29 29 数据30 30 数据31 31 数据32 32 数据33 33 数据34

陈表达的博客 5981

前端唤起本地应用的终极解决方案:原生JS与Vue实现指南

这篇文章详细介绍了跨浏览器唤起本地应用的完整解决方案。主要内容包括:1)技术原理剖析,通过自定义URL协议和事件监听实现应用唤起;2)原生JavaScript实现方案,针对不同浏览器提供兼容性处理;3)Vue专属优化方案;4)关键问题解决方案如浏览器拦截处理和移动端适配;5)安全实践建议包括HTTPS要求和协议白名单;6)现代替代方案介绍。文章提供了生产级代码实现,覆盖主流浏览器兼容性问题,并强调安全最佳实践。该方案已在多个生产环境验证,支持Chrome、Firefox、Safari、Edge及IE10+等

人和代码有一个能跑就行 3815

【软件逆向】带壳带反调试找flag教程(VMProtect3.0+X64dbg+ScyllaHide)

【软件逆向】带壳带反调试找flag教程(VMProtect 3.0+X64dbg+ScyllaHide)

zhangjiuding的博客 7509

JS中调用本地exe程序

场景 在网页中通过js调用Windows上本地的exe程序, 比如在浏览器中点击调用某播放器的exe程序。 url protocol 的方式来实现。用这种方式实现,任何浏览器都兼容, 不会存在只有IE或FIREFOX才行的情况。都用过QQ,迅雷,电驴,在网页上点击的时候, 就会弹出QQ,或者迅雷,电驴的下载界面,用的就是这个原理,在微软的MSDN上也有说明。 Registering an Application to a URI Scheme (Windows) | Microsoft Docs

BADAO_LIUMANG_QIZHI的博客 9638

华为OD机试 - 文件存储系统的排序 - 深度优先搜索dfs(Java 双机位C卷 200分)

华为OD机试 双机位C卷题库疯狂收录中,刷题。

学Java,找哪吒 719

SAP 业务技术平台(BTP) Workflow(工作流)功能介绍

这背后其实发生了很多事情:Workflow 应用里 Determine Equipment Service Task 得到执行,通过 HTTP POST,消费部署在 SAP BTP 上的 Business Rules Service,后者根据我们在 Start New Instance 里传入的 Sample Data,返回自动决定出的设备明细。关于这个 SAP BTP 开发工具的更多介绍,参考我的文章:SAP 新一代全栈开发工具:SAP Business Application Studio.

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 8752

js调用可执行性(exe)文件

转自 http://wmnmtm.blog.163.com/blog/static/382457142011814104554831/  js调用可执行性(exe)文件   cript">    function   open_exe(shellp,str)    {    a=new   ActiveXObject("wscript.shell");    a.run(sh

wugang0825的专栏 987

突破边缘AI算力瓶颈:YOLOv12模型剪枝与知识蒸馏联合优化全攻略

这套剪枝-蒸馏联合方案的优势在于其系统性和可靠性。它不是单一的技巧,而是一套完整的工程流程,确保了从研发到部署的无缝衔接。

m0_71589036的博客 219

JS调用可执行exe

JS调用可执行本地exe文件: <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getSe...

weixin_30885111的博客 241

04-协议基础03:USB 2.0信号与电气特性

USB 2.0使用两根差分信号线D+/D-进行数据传输,支持低速(1.5Mbps)、全速(12Mbps)和高速(480Mbps)三种速率。USB总线为主从模式,所有事务由Host发起。端电阻值作用HostRpd(D+)15KΩ±5%下拉,默认低电平HostRpd(D-)15KΩ±5%下拉,默认低电平全速设备Rpu(D+)1.5KΩ±5%上拉到3.3V,标识全速低速设备Rpu(D-)1.5KΩ±5%上拉到3.3V,标识低速USB 2.0硬件要点。

内核笔记 104

hwasan实例分析踩内存之七:CamX进程chifeature2base怪异的Cause: use-after-free

摘要:本文分析了高通camx进程中的指针异常crash问题,通过构建hwasan版本确认存在内存踩踏现象。日志显示为"use-after-free"类型错误,具体为线程T175672在已释放内存区域执行写入操作。堆栈分析表明ChiFeature2Base::PipelineDestroyCb()函数访问了已被ChiFeature2Base::DestroyFeatureData()释放的pPipelineData对象。该问题源于多线程环境下内存管理不同步,导致释放后仍被引用。解决方案通过

1077

javascript flash 调用 exe 可执行文件 的例子

直接转载自: http://blog.sina.com.cn/s/blog_5ca9fdd80100bdh1.html function open_exe(shellp,str) { a=new ActiveXObject("wscript.shell"); a.run(shellp+" "+str); } ...

msnvip 369

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

js调用可执行性(exe)文件(仅IE可用)

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_33912638的博客 320

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

js调用exe可执行文件(IE8)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Conten

知行合一 1489

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

JAVA 爬虫获取js动态生成的网页数据

问题: 有些网页数据是由js动态生成的,一般我们抓包可以看出真正的数据实体是由哪一个异步请求获取到的,但是获取数据的请求链接也可能由其他js产生,这个时候我们希望直接拿到js加载后的最终网页数据。解决方法: phantomjs 1.下载phantomjs,[官网]:http://phantomjs.org/ 2.我们是windows平台,解压,会在bin目录下看到exe可执行文件,有它就够啦

ylzhusky的博客 1万+

JS调用exe程序

JS调用exe程序 1.准备一个.exe的可执行文件,在D盘下新建文件夹JSexe,在JSexe下新建C++文件,命名为MakeExe,并写入如下代码 #include #include #include using namespace std; int main(int argc, char * argv[]) { int a; for(int i=0;i<argc;i++){

赵侠客 1万+

Javascript代码直接调用计算机中的程序

  网页制作的简单小技巧,用网页中的代码直接可以调用计算机中的可执行文件。   把下面代码直接放到HTML网页的<body>里面。 以下是引用片段:<SCRIPTLanguage="JScript"> functionruncmd(){ File="cmd.exe"; WSH=newActiveXObject("WScript....

weixin_34337265的博客 237
上一篇: eclipse适合字体
下一篇: 分区表的查询
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值