When trying to complete a Windows-based script for any type of system administration - at work, volunteering at my church & school, or otherwise - I've always been a bit intrigued at why anyone would choose VBScript over JScript.
While some of Microsoft's own examples are written in both VBScript and JScript, many are written exclusively in VBScript. I've not found any documentation that shows that VBScript is supported any better by - or has better support for - the Windows Script Host than JScript.
I finally happened to run across a great article that summarizes why JScript should be preferred, and lists many of the same reasons why I always convert any WSH scripts I'm involved in to JScript. The article is Eight Reasons Windows Administrators Should Learn JScript Instead of VBScript by Bill Stewart, on O'Reilly WindowsDevCenter.com.
Stewart's key points, followed by some of my highlights:
- JScript Is More Widely Used
- JScript Is Alive and Well
- JScript Is Easy to Learn
- JScript Is Object-Oriented
- JScript's Regular Expression Handling Is Better
- JScript Arrays Are Much More Powerful
- JScript Date Handling Avoids Local Time Problems
- JScript Has Better Exception Handling
- By comparison, exception handling is practically non-existent in VBScript.