• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 647
  • Last Modified:

Problem with WSUS script for Server 2008 core

I am testing Server 2008 Core and cannot get the script at http://msdn.microsoft.com/en-us/library/aa387102(VS.85).aspx to work properly. It runs fine up to the point where it asks if I want to install the updates if found, I must answer Y/N but the dialog box only has OK. Y or N on the kb has no affect and clinking OK gives me a script error for line 61 (where it asks for my Y or N input), the error is "the handle is invalid".

Why is my dialog box coming up with just OK when it should be Yes or No? The relevant code is below, all of the code is at the link above.
WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
strInput = WScript.StdIn.Readline
If (strInput = "N" or strInput = "n") Then 
ElseIf (strInput = "Y" or strInput = "y") Then
	WScript.Echo "Installing updates..."

Open in new window

1 Solution
may it works with a vbscript msgbox

strInput = MsgBox ("Would you like to install updates now? (Yes/No)",vbYesNo)
If strInput = vbNo Then
ElseIf strInput = vbYes Then
	WScript.Echo "Installing updates..."
	WScript.Echo "Anything else"
End If

Open in new window

LarryDAHAuthor Commented:
Thanks, that did it. I made a small tweak and added some text back in to show when the updates finished but you got me past the yes/no issue.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now