Script2EXE Home How to Use Interface Buy Support Site Home

2 Samples: How to use Command Line Parameters


1. Console Program Sample
function main(par)
{
    HOST.Print("\nCommand Line Parameters:\n");
    for(var i=0; i<=HOST.argc; i++)
    {
        HOST.Print(HOST.argv(i));
        HOST.Print("\n");
    }
    return(0);
}
2. Window Program Sample
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Command Line Parameters</TITLE>
<SCRIPT language="JavaScript">
function ShowCommandParameters()
{
    var cs="";
    for(var i=0; i<=window.external.argc; i++)
    {
        cs+=window.external.argv(i);
        cs+="\n";
    }
    cmdpars.innerText=cs;

}
</SCRIPT>
</HEAD>

<BODY bgColor="#000000" onload="ShowCommandParameters()">
<pre id="cmdpars" style="font:x-small Verdana, Arial, Helvetica, sans-serif;color:#ffffff;margin-top:0;margin-bottom:0">
</pre>
</BODY>
</HTML>