Option Explicit ' Edit Last NWC2 User Tool Run ' Standalone script, not a User Tool ' by Rick G. tested on Win98, NWC2 Beta 2.19 Const exts = ".php|.vbs|.js|.py|.cmd|.bat" Const NWC2RK = "HKCU\Software\NoteWorthy Software\NoteWorthy Composer 2\" Dim wso: Set wso = CreateObject("WScript.Shell") Dim fso: Set fso = CreateObject("Scripting.FileSystemObject") Dim sho: Set sho = CreateObject("Shell.Application") Dim ext, delimiter, lut, s lut = wso.RegRead(NWC2RK & "Options\LastToolRun") s = fso.BuildPath(NWC2Folder("Config"), "nwc2UserTools.ini") ' filename s = fso.OpenTextFile(s).ReadAll ' file contents s = Filter(Split(s, vbCr), vbLf & lut & "=")(0) ' pertinent line from file s = Split(s, "=")(1) ' &Command: For Each ext In Split(exts & "|", "|")   If InStr(1, s, ext, 1) Then Exit For Next If ext = "" Then WScript.Quit ' no match If Asc(s) = 39 Then s = Mid(s, 2, Len(s) - 2) ' strip single quotes delimiter = Mid(s & " ", InStr(1, s, ext, 1) + Len(ext), 1) ' space|quote s = Filter(Split(s, delimiter), ext, vbTrue, 1)(0) ' relative path wso.CurrentDirectory = NWC2Folder("root") s = fso.GetAbsolutePathName(s) sho.Namespace(Left(s, 3)).ParseName(Mid(s, 4)).InvokeVerb("&Edit") Function NWC2Folder(sKey)   Select Case sKey     Case "Songs": NWC2Folder = wso.SpecialFolders("MyDocuments")     Case "InstrumentTrees": NWC2Folder = "itrees"     Case "AutoSave", "Config", "Templates": NWC2Folder = sKey     Case "PageCopy", "root"     Case Else: Err.Raise 17, "NWC2Folder", sKey ' bad sKey   End Select   On Error Resume Next   NWC2Folder = wso.RegRead(NWC2RK & sKey)   If Err = 0 Or sKey = "Songs" Then Exit Function   NWC2Folder = fso.BuildPath(fso.GetFile( _     wso.RegRead("HKCR\nwcomposer\shell\nwc2\command\") _     ).ParentFolder, NWC2Folder) End Function