REM **********************************************************
REM Wscript で実行された場合は Cscript で実行しなおす
REM **********************************************************
Function Crun( )
if ScriptType <> 1 then
Exit Function
end if
Dim str
str = WScript.FullName
str = Right( str, 11 )
str = Ucase( str )
if str <> "CSCRIPT.EXE" then
str = WScript.ScriptFullName
GetWshShell
strParam = " "
For I = 0 to Wscript.Arguments.Count - 1
if instr(Wscript.Arguments(I), " ") < 1 then
strParam = strParam & Wscript.Arguments(I) & " "
else
strParam = strParam & Dd(Wscript.Arguments(I)) & " "
end if
Next
Call WshShell.Run( "cmd.exe /c cscript.exe " & Dd(str) & strParam & " & pause", 3 )
WScript.Quit
end if
End Function
Function Crun2( nCol )
if ScriptType <> 1 then
Exit Function
end if
Dim str
str = WScript.FullName
str = Right( str, 11 )
str = Ucase( str )
if str <> "CSCRIPT.EXE" then
str = WScript.ScriptFullName
GetWshShell
strParam = " "
For I = 0 to Wscript.Arguments.Count - 1
if instr(Wscript.Arguments(I), " ") < 1 then
strParam = strParam & Wscript.Arguments(I) & " "
else
strParam = strParam & Dd(Wscript.Arguments(I)) & " "
end if
Next
Call WshShell.Run( "cmd.exe /c mode con: cols=" _
& nCol & " & cscript.exe " & Dd(str) & strParam & " & pause", 3 )
WScript.Quit
end if
End function