General discussion

Locked

How to execute bat file from HTML or Javascript

By blndo2001 ·
Any one can answer me how to execute a bat file from HTML, XTML or Javascript. Is there any command for that.

Thanks in advance

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by jeremyrem In reply to How to execute bat file f ...

ur best bet would be either converting the app to javascript and running it that way or rooting it.. only if it is your own computer or you do have consent to do so.. because it is a federal crime..


first u would need to assemble a group of programs you would need. such as cuteftp..
mainly for the support of the exec command.. with lets you upload a file and then execute it on the target computer. aka ur office computers say if you were to do a mass upgrade of software..

second i recommend a silent version of tightvnc.. because sometimes i like to see windows instead of commandline.(ftp) now vnc is hard to turn into a service without already being installed mainly for the password part.. with is located in the regisitry..

third... FireDaemon. what is used to create windows services' entries. a few bat files to berun to combine all the services/programs. such as something easy as


run.bat
copy ftp.zip c:\windows\adminftp
copy vnc.zip c:\windows\adminftp
copy fire.zip c:\windows\adminftp
extract .... c:\windows\adminftp\start
second.bat

second.bat
install the services..(its about 4:00am and im kinda tired. nolonger have the programs installed)
so just run the FireDaemon program in cmd to find the command lines.. and create the services

then of course.. the third.bat for when it accidently goes down..

third.bat
netstart "servicename"

and that is how you root your computer.. for administrative purposes only

and the programs i have listed work best when you have the full version.. it does not pay to pirate. in reality you hurt ur self with not getting as quality as products in the future

Collapse -

by georgerogers39 In reply to How to execute bat file f ...

To add batch files to an HTML document, simply place the files name in an "a href" command like this:
<a href="#file.bat">Batch File</a>

The # sign tells the computer that the link is internal and not external, so the computer won't try to search the World Wide Web for your file.

Collapse -

by georgerogers39 In reply to

The code for adding batch files is a href(equal sign)"file.bat" add<and > around a href and the last ".
And then put the word Batch after the last>then place </a>

Collapse -

by _amitchandan In reply to How to execute bat file f ...

Hi,
Just create a batch file and save in the location where your html file is there.

<a href="test.bat">TEST</a>

this anchor tag will execute the (test.bat) batch file. After clicking on the link <TEST>, you will get the window prompting to open/save/close, if you will click on open then batch file will be executed.

But this is not unattended execution, I want that there should not be any prompt to open/save the batch file.

Thanks
Amit

Collapse -

by Yaacov.Pinhas In reply to

Hi,

Try this:

WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("explorer file:///D:\\temp\\1.bat",1,true);

Best regards,
Yaacov Pinhas.

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums