IE和Firefox下執行exe程式

2021-06-07 23:43:33 字數 1814 閱讀 4810

>

click here to execute your file<

/a>

if (!document.all)

var ws = new activexobject("wscript.shell");

ws.exec("d:\\software\\youfile.exe"); }

>

>

click here to execute your file<

/a>

function

netscape.security.privilegemanager.enableprivilege('universalxpconnect');

var file=

components.classes["@mozilla.org/file/local;1"].createinstance(components.inte***ces.nsilocalfile);

file.initwithpath("d:\\software\\yourfile.exe");

file.launch();

}<

/script>

例子:如果exe帶引數則

var args = ["argument1", "argument2"]; 

var file = components.classes["@mozilla.org/file/local;1"]  

.createinstance(components.inte***ces.nsilocalfile);  

// create an nsiprocess

var process = components.classes["@mozilla.org/process/util;1"]  

.createinstance(components.inte***ces.nsiprocess);  

process.init(file);  

// run the process.

// if first param is true, calling thread will be blocked until

// called process terminates.

// second and third params are used to pass command-line arguments

// to the process.

var args = ["argument1", "argument2"];  

process.run(false, args, args.length); 

如:var arguments = ["-h","10.20.65.41","-p","5901","-w","11111111","--title","1111"];

積累:

var wss = new activexobject("wscript.shell");  

wss.regwrite("hkey_current_user\\software\\microsoft\\windows nt\\currentversion\\windows\\device","pdffactory pro,winspool,fpp2:");  

var wss = new activexobject("wscript.shell");

wss.regwrite("hkey_current_user\\software\\microsoft\\windows nt\\currentversion\\windows\\device","pdffactory pro,winspool,fpp2:");

ul在Firefox和IE下的不同表現

最近做了個oblog的系統模板,其中涉及到了ul,所以就整理出了這篇文章 這張大圖。ul是乙個很常用的標籤,但是因為它在firefox和ie下的不同表現,讓人覺得它是個很難以控制的標籤。ul在firefox下有個padding值,卻沒有margin值 而在ie下正好相反,ul有個margin值,卻沒...

ie和firefox中的不同

今天 3.17 遇到了乙個超鬱悶的問題,我用getelementsbyname時,在ie中怎麼也得不到乙個這個document物件,而firefox中卻可以。非常得納悶。google一下才發現兩個瀏覽器在使用方面有一下不同 w3c規範中getelementsbyname是按著name屬性進行檢索的,...

如何用JS識別IE和firefox

昨天又弄了乙個html,這個html是為了出測試報告用的,所以要求對ie和firefox都要支援,所以要用js對二者進行判斷,網上一搜,n多帖子,總體上大家寫的都還不錯,如下,window.nl ad function function createlistener false obj event....