View Single Post
  #3 (permalink)  
Old February 17th, 2005, 07:41 AM
pgtips pgtips is offline
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

if your script is run from the DOS prompt,i.e. using cscript not wscript, then you need:
WScript.StdIn.ReadLine()

I use this general function in my scripts:
Code:
Function GetUserInput(sPrompt)

     If GetRunMode() = 0 Then
         GetUserInput = InputBox(sPrompt)
     Else
         WScript.StdOut.Write sPrompt
         GetUserInput = WScript.StdIn.ReadLine()
     End If

End Function

you'll also need this referenced function

Function GetRunMode()

    ' determines if script running under windows or command-line
    ' returns 0 for Win, non-0 for Cmd
    GetRunMode = InStr(1, WScript.FullName, "cscript.exe", 1)

End Function
hth
Phil
Reply With Quote