Palermo .Net Scripter utility replaces CSScripter by offering full support for C#, VB.Net and JScript.Net command-line scripting – level 200

Earlier, I posted my C# Scripter command-line utility.  I only have a need to script C#, so that’s all the capability I added initially, but there was some interest in scripting VB.Net, so I refactored and enhanced my scripter, and I’ve renamed it “netscripter.exe”.  No need to install it.  Just drop it in your tools directory and use it against any file with .Net code in it.  It now supports C#, VB.Net, and JScript.Net.  It’s switches on the file extension, so name your script files .cs, .vb, and .js respectively.  The script file must be compilable into a console app to be compatible, and that’s very simple to do.  With the download, I’ve included a sample script file for each of the languages. You can use those as references.  I’m not sure what features can be added to this simple tool beyond what is there, but I’m open for suggestions.  Just in the last few days, this tool has saved my team a _ton_ of time with mechanical task that are just a little to complicated for shell files, but simple to do with .Net.


You can download the new NetScripter here.


Don’t forget to leave me feedback.

C# Scripter: How to execute C# as batch files with my new utility – level 200

UPDATE:  This utility has been upgraded to support more .Net languages.  See here for the newer version.


The Windows shell has some great programming capabilities, and we can do a lot with it, but these days, I can whip something out with C# and basically do anything I need to with files.  It takes me considerably longer to do the same thing with DOS commands (mostly because I don’t know advanced shell scripting).  When Monad comes out in the next version of Windows, we’ll have .Net integrated into the shell, but that is many years away.  I’m left wanting to execute C# batch-style.


It’s no problem to create a console app and run it, but I want to have the .cs file available for tweaking, so it’s not feasible to just create a bunch of .exe files.  I needed a true C# scripting solution.


I now introduce the Palermo C# Scripter.  On the command line, it’s csscripter.exe, and it takes as an argument the name of the C# file.  For example:  csscripter.exe myBatch.cs


myBatch.cs just has be a valid console class like the following:


    1 using System;

    2 using System.Collections;


    3 using System.IO;


    4 using System.Windows.Forms;


    5 


    6 public class Whatever


    7 {


    8     public static void Main(string[] args)


    9     {


   10         Console.WriteLine(“Other Script file executed. ” + string.Join(“|”, args));


   11         MessageBox.Show(“You can even do pop-ups”, “With a title”);


   12     }


   13 }


I’m using this now to traverse thousands of nested files searching for little things and doing small things when I find something.  This is the same stuff I’d do with batch files, but now I have the power of C# in text form doing it for me. 


You can download the utility from me here.


If you have feedback or a feature request, please leave me a comment.  In putting this together, I came across some good references on C# scripting:


Gmail does it again with fat-client-like features – level 000

I was typing an email with Gmail today, and I was pleasantly surprised that auto-saved my email to a draft.  I have conditioned myself to copy test to the clipboard before I submit it to any webpage, and I even do it with blog posts because if the HTTP request fails, you just lost it all.  No more chance of losing an email with Gmail.


Check out Gmail’s newest features: http://mail.google.com/mail/help/about_whatsnew.html