How to invoke script by comand line and javascript?

Discuss and share scripts and script files...
Post Reply
ruslaw
Posts: 8
Joined: 21 May 2014 17:59

How to invoke script by comand line and javascript?

Post by ruslaw »

I can call XYplorer from command line with command:

Code: Select all

start "" "D:\programs\xyplorer\XYplorer.exe"
and with javascript:

Code: Select all

<html><head>
        <script type="text/javascript">
        function runProgram()     { 
            var shell = new ActiveXObject("WScript.Shell");
            var appWinMerge = "D:\\programs\\xyplorer\\XYplorer.exe";
            shell.Run(appWinMerge);
        }
        </script>
    </head><body>
    <a href="javascript:runProgram()">Run program</a>
    </body></html>
How to modify them if I need to start XYplorer and invoke script from myscript.xys file and could I put this script file at any place I need not only at "..\Data\Scripts\" ?
Thanks

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: How to invoke script by comand line and javascript?

Post by PeterH »

Basically supply start with parameter /script=x:\a\b\name.xys

Don't know how to do that in javascript... :roll:

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

Re: How to invoke script by comand line and javascript?

Post by highend »

Is this really different from your previous posting (http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=11749)?

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=\"D:\\Temp\\test.xys\"";
            shell.Run(appWinMerge);
        }
        </script>
    </head>

    <body>
        <a href="javascript:runProgram()">Run program</a>
    </body></html>
One of my scripts helped you out? Please donate via Paypal

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

Re: How to invoke script by comand line and javascript?

Post by ruslaw »

thanks a lot

Post Reply