Option Explicit Dim WshShell, FSO, sEditor, objArgs, FileList, sFile Set objArgs = WScript.Arguments Set WshShell = WScript.CreateObject("WScript.Shell") sEditor = WshShell.ExpandEnvironmentStrings(objArgs(0)) If objArgs.Count < 2 Then WshShell.Run """" & sEditor & """", 1, False Else Set FSO = CreateObject("Scripting.FileSystemObject") Set FileList = FSO.OpenTextFile(objArgs(1), 1, False) Do While Not FileList.AtEndOfStream sFile = FileList.ReadLine If Right(sFile,1) = "\" Then WshShell.Run """" & sEditor & """", 1, False Exit Do End If WshShell.Run """" & sEditor & """" & " " & """" & sFile & """", 1, False Loop End If WScript.Quit |