Arguments for Console Application

I am writting console application using JScript. How do get the command line arguments? Possible?
[110 byte] By [WJ] at [2008-2-19]
# 1
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?

WJ at 2007-10-6 > top of Msdn Tech,.NET Development,JScript for the .NET Framework...
# 2
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.

HeathStewart at 2007-10-6 > top of Msdn Tech,.NET Development,JScript for the .NET Framework...
# 3
I wonder why it is not provided in JScript .NET.

can we access .NET object using Windows Scripting host?

WJ at 2007-10-6 > top of Msdn Tech,.NET Development,JScript for the .NET Framework...
# 4
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.
HeathStewart at 2007-10-6 > top of Msdn Tech,.NET Development,JScript for the .NET Framework...
# 5

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

RokYu at 2007-10-6 > top of Msdn Tech,.NET Development,JScript for the .NET Framework...

.NET Development

Site Classified