.Net Equivalent to a VBS Script?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to build a .net file in C# which will JIT compile and execute
when double-clicked (a la the old .vbs scripting approach)? This would just
be a nice, convenient way for me to do some scripting where I don't want to
have to build a whole project and application.

Alex
 
Hi Alex,

I am sorry but I don't think you could build a program in C# which will be
JIT compiled and executed when double-click just like the old .vbs
scripting approach.

In fact, .Net programs do have the feature of JIT compilation, however,
this JIT compilation is different from the JIT compilation of .vbs
scripting approach. We must compile the .Net source file into Microsoft
intermediate language first and the JIT compiler will convert the MSIL to
native code when the program is executed.

For more information on JIT compilation in .Net framework, you may refer to
the following link.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconjitcompilation.asp

If you have anything unclear, please feel free to tell me.



Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
If you're going to build a C# source file, then why not add an extra step
using ICodeCompiler to build it into an executable? Then you can obviously
run it!
 
Alex said:
Is there a way to build a .net file in C# which will JIT compile and execute
when double-clicked (a la the old .vbs scripting approach)? This would just
be a nice, convenient way for me to do some scripting where I don't want to
have to build a whole project and application.

Alex

Hi Alex,

There's nothing "out of the box", but this article by Dino Esposito
might help:

http://www.vsj.co.uk/articles/display.asp?id=417

Damien
 
Back
Top