Function Cscript()'As Boolean 'Forces this script to be run under cscript by re-launching 'it with up to 10 arguments if needed. Typical usage: 'If Not Cscript() Then Wscript.Quit Dim strCommand 'As String Dim intArgument 'As Integer If Lcase(Right(Wscript.FullName, 12)) = "\cscript.exe" Then Cscript = True Else strCommand = "cscript.exe " & Wscript.ScriptFullName For intArgument = 0 to 9 If Wscript.Arguments.Count > intArgument Then strCommand = strCommand & " """ & Wscript.Arguments(intArgument) & """" End If Next Wscript.CreateObject("Wscript.Shell").Run strCommand Cscript = False End If End Function