how to call XYplorer script from web-page?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
ruslaw
Posts: 8
Joined: 21 May 2014 17:59

how to call XYplorer script from web-page?

Post by ruslaw »

In the topic "Command line" there was an advice how to make XYplorer to open left and right panel with definite directories.
It was supporting files StartXYplorer.exe and StartXYplorer.ini and command line code:
<your path to StartXYplorer.exe>\StartXYplorer.exe "<path for left side>" "<path for right side>"
OK! I can make bat file and it gives me an effect.
But what if I need to call this code from html page? Can I do it? Can I use javascript and how?

highend
Posts: 14954
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: how to call XYplorer script from web-page?

Post by highend »

http://stackoverflow.com/questions/2800 ... -hyperlink

E.g.:

Code: Select all

<html>
    <head>
        <script type="text/javascript">
        function runProgram()
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "\"D:\\Users\\Highend\\Tools\\Xyplorer\\XYplorer.exe\" /script=\"::msg 'Welcome'\"";
            shell.Run(appWinMerge);
        }
        </script>
    </head>

    <body>
        <a href="javascript:runProgram()">Run program</a>
    </body>
</html>
Adapt your path and the script content...
One of my scripts helped you out? Please donate via Paypal

ruslaw
Posts: 8
Joined: 21 May 2014 17:59

Re: how to call XYplorer script from web-page?

Post by ruslaw »

Thans a lot!
I have adopted for my purpose (to open definite directory) so:

Code: Select all

 <script type="text/javascript">
        function runProgram()
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "\"D:\\programs\\xyplorer\\XYplorer.exe\" /script=\"::goto 'E:/Documents'\"";
            shell.Run(appWinMerge);
        }
<a href="javascript:runProgram()">Run program</a>
And it works well.
But can I somehow transform it into function with argument like so:

Code: Select all

 <script type="text/javascript">
        function runProgram(path)
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "\"D:\\programs\\xyplorer\\XYplorer.exe\" /script=\"::goto path\"";
            shell.Run(appWinMerge);
        }
        </script>
  <a href="javascript:runProgram('E:/Documents')">Run program</a>
Given above example doesn't work but I need I could use one piece of code for function and to vary destination folders within <body></body>
Is it possible?

highend
Posts: 14954
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: how to call XYplorer script from web-page?

Post by highend »

Code: Select all

<html>
    <head>
        <script type="text/javascript">
        function runProgram(path)
        {
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "\"D:\\programs\\xyplorer\\XYplorer.exe\" /script=\"::goto \"" + path + "\"\"";
            shell.Run(appWinMerge);
        }
        </script>
    </head>

    <body>
        <a href="javascript:runProgram('E:/Documents')">Run program</a>
    </body>
</html>
It's nothing more than concatenating the local path variable...
One of my scripts helped you out? Please donate via Paypal

Post Reply