Arguments for Console Application

I am writting console application using JScript. How do get the command line arguments Possible


Answer this question

Arguments for Console Application

  • Miguel Gzz

    You can only access .NET objects once you've registered them using regasm. You will not be able to access static members.

    The following article "Registering Assemblies with COM" describes some steps you need to take to access .NET objects from COM. http://msdn2.microsoft.com/h627s4zy.aspx

     


  • CCL

     WJ wrote:
    I am writting console application using JScript. How do get the command line arguments Possible


    How to access command line arguments in Jscript .NET

  • Ruba81

    I wonder why it is not provided in JScript .NET.

    can we access .NET object using
    Windows Scripting host

  • dmatalus

    You can use the WScript.Arguments property. The WScript object is only available when the script is running in the wscript.exe, cscript.exe, or msscript.ocx scripting hosts because it is provided by the Windows Scripting host.

    See http://msdn.microsoft.com/library/en-us/script56/html/wsproarguments.asp for more information and examples.

  • SandieM

    JScript and JScript.NET are two different things that only share some syntax (about as different as Java and JavaScript/JScript). JScript is executed by a scripting host like IE or cscript/wscript. The latter two actually provide the WScript object.

    To access command-line arguments in JScript.NET you can use Environment.GetCommandLineArgs() to return a String[] array.

  • Arguments for Console Application