Home All Groups Group Topic Archive Search About

.Net Equivalent to a VBS Script?

Author
20 Aug 2006 3:19 PM
Alex Maghen
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

Author
20 Aug 2006 5:18 PM
Flowering Weeds
"Alex Maghen"

> Is there a way to build a .net file in C#

>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.
>

Perhaps:

Microsoft's free CMD.exe .NET
upgrade Windows PowerShell

MSN Search
http://search.msn.com/results.aspx?q=PowerShell
Author
21 Aug 2006 11:40 AM
Linda Liu [MSFT]
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.
Author
21 Aug 2006 5:50 PM
Phil Wilson
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!
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Show quote
"Alex Maghen" <AlexMaghen@newsgroup.nospam> wrote in message
news:B58EB8EC-0209-4CDE-90C9-A25DBE93252E@microsoft.com...
> 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
Author
22 Aug 2006 4:07 AM
Damien
Alex Maghen wrote:
> 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

AddThis Social Bookmark Button