CODE: [Copy to clipboard]
host = WScript.FullName
hostexe = lcase(mid(host, InstrRev(host, "\")+1))
if not hostexe = "cscript.exe" Then
set wshshell = CreateObject("WScript.Shell")
wshshell.run "CSCRIPT.EXE """ & WScript.ScriptFullName & """"
WScript.Quit
end If
set input = WScript.StdIn
set output = WScript.StdOut
output.Write "> "
do until input.atEndOfStream
line = input.ReadLine
if lcase(line)="exit" then
exit do
else
line = Replace(line, "?", "output.WriteLine")
ExecuteIt line
output.Write "> "
end if
loop
sub ExecuteIt(command)
on error resume Next
ExecuteGlobal command
if not err.Number=0 Then
output.WriteLine "Error: " & err.description
err.clear
end if
end sub
[