Best "official" scripting language for Windows programmers

19,018

Solution 1

PowerShell - designed from the ground up to be a Windows scripting language, and it can hook into the CLR for advanced functionality.

(yes, I realize this doesn't run under cygwin... but why is that a requirement?)

Solution 2

When I've written cross-platform product installers, coding a UNIX shell script for Linux/Mac/Solaris etc. is really easy, but trying to do equivalent tasks in BAT is like working in the dark, underwater, with both hands tied behind your back. I can't state strongly enough that BAT scripts are a blight on humanity.

So what I've heard about PowerShell makes me happy. It's a life-saver for Windows developers. The only trouble is that I believe it's still a separate install, it isn't available by default (I've read that it'll be on Windows Server 2008 and Windows 7).

Oh well, it only took Microsoft 20 years to replace BAT scripts with something as capable as UNIX shell, so I guess I shouldn't be too ungrateful! >:-P

Get the installer for PowerShell here:

http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx

Solution 3

I'll try to provide an alternative - JavaScript and VBScript work fine too even on Windows versions long gone, and they don't need a seperate installation like PowerShell. ;) Of course, PowerShell has more power :P

Solution 4

I'd urge you to give Python a chance. It looks a little odd to 'C' programmers at first, but its easy to pick up and more importantly easy to remember. You are going to have interns of various skill levels using and modifying the code so you want something that can draw from a wide user base. And if you are going to go to the trouble of installing something new why choose powershell which is going to be a dead end for anyone using it.

Solution 5

If you are like me and want to display nifty progress bars or splash screens while your script is doing it's magic (instead of a black/gray command prompt window), use AutoHotkey. Showing a progress bar is a PITA with JScript/VBScript (WSH) and/or PowerShell from what I've found. In AHK it's as simple as:

Progress, b2 m, ACME App, Doing some magic...

Also you can interact with almost any control in any window and automate apps which are not meant to be automated.

Share:
19,018
Eugene Yokota
Author by

Eugene Yokota

Hi, I'm Eugene (eed3si9n). I am a software engineer and an open source contributor mostly around Scala. As the core maintainer of sbt, a build tool used in Scala community, I like helping debug and explain sbt. Other projects I contribute to: scalaxb, an XML databinding tool for Scala (author) treehugger.scala (author) scopt/scopt (maintainer) Twitter: @eed3si9n Github: @eed3si9n

Updated on June 27, 2022

Comments

  • Eugene Yokota
    Eugene Yokota almost 2 years

    Suppose there were several projects mostly maintained by smart interns, who eventually leave after a period of time. Scripts are used here and there in key parts, for example, to back up a database, rename it, zip it, move it over ssh, unzip it, and then to restore it with different settings. You know, the scripting stuff.

    The programming languages for the application side is set, but those for scripts have been relaxed. Currently there are probably healthy mix of bash and .bat file, and maybe some Perl.

    1) To avoid language proliferation, and 2) because I don't want to force bash upon future Windows programmers, I'd like to set an "official" scripting language.

    Google picked Python for this, and it's famous for being readable, easy to learn, and having good library; however, I personally don't find it that readable compared to C-like grammar, Pascal, or Ruby.

    In any case, if you were to be forced to use only one scripting language on a Windows machine (with Cygwin if you want to) for all scripting, what would you like it to be, and why?

    Related religious wars:

  • Eugene Yokota
    Eugene Yokota over 15 years
    I meant to say that Cygwin is available for ssh and other things if needed.
  • dkretz
    dkretz over 15 years
    Not a problem. Google for "powershell ssh".