Sorting an array is a common scripting task, but VBScript doesn't provide a native capability to do so. To fill this gap, Bill Stewart has written VBSort.wsc. This Windows script component implements the Penton.VBSort object, which provides three properties and a method that let you quickly sort VBScript arrays.
Bill discusses how to register and use VBSort.wsc in "Sorting Arrays in VBScript". He also presents a script, Sorter.vbs, that uses VBSort.wsc in "Using the Penton.VBSort Object to Sort Arrays". You can use Sorter.vbs to sort data in one file, then write the sorted data to another file. You can also use it to sort redirected lines of text. I opened up both articles for public viewing through May 1. If you enjoy reading these articles, you can get more of this type of content by subscribing to Scripting Pro VIP.