Permalink
Browse files

Fix for Vista/7 which don't have ScriptPW.Password by default

  • Loading branch information...
1 parent d3703cc commit 3603936a07038b373fc0f762cd83f43519847f15 @tresni tresni committed Apr 7, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 fetchstats.vbs
View
10 fetchstats.vbs 100644 → 100755
@@ -51,9 +51,17 @@ If Wscript.Arguments.Count = 4 Then
End If
WScript.StdErr.Write "Password: "
+
+' Are they running Vista or 7?
+On Error Resume Next
Set objPassword = CreateObject("ScriptPW.Password")
-Password = objPassword.GetPassword()
+If objPassword <> Null Then
+ Password = objPassword.GetPassword()
+Else
+ Password = WScript.StdIn.ReadLine
+End If
Wscript.StdErr.Write vbCrLf
+On Error GoTo 0
Set regEx = New RegExp
regEx.IgnoreCase = true

0 comments on commit 3603936

Please sign in to comment.