0

This is important for me as I have a PRN file which can be printed only through command prompt. And I want to delete that file after the print command is given.

So these 2 commands can be executed using batch file only.

And when I try to use activexobject in javascript, my firefox browsers doesnt run it.

<script>
MyObject = new ActiveXObject("WScript.Shell");
function Runbat()
{
MyObject.Run("\"D:\\abc.bat\"");
}
</script>
0

1 Answer 1

0

Together in a html page.

I've found this one and it seems working properly :)

<html>
    <head>
        <script language="JavaScript" type="text/javascript">
            MyObject = new ActiveXObject("WScript.Shell")
            function Runbat()
            {
                MyObject.Run("\"D:\\test.bat\"");
            }
        </script>
    </head>
    <body>
        <h1>Run a Program</h1>
        This script launch the file any bat File<p>
        <button onclick="Runbat()">Run bat File</button>
    </body>
</html>

Now I don't really know if you are already working with exaclty that solution, if so, and you are still facing this issue in firefox you may need to investigate a little bit more in browser security to know if that is even possible as of this post states that:

No, that would be a huge security breach. Imagine if someone could run

format c:

whenever you visted their website.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, I understand your point about security breach. But I am going to provide this to just 1 person that also for his own admin panel. It;s nit going to public. Any guidance why this is not working for Mozilla?
@Vivek "You mean launch an external program thru a browser window using JavaScript? No way you can do that! That's a goddamn security black hole!" So you would need to start configuring Mozilla Server-Sided and that (I think) is not possible for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.