Solved

Problem with WSUS script for Server 2008 core

Posted on 2009-04-08
2
632 Views
Last Modified: 2012-06-21
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.
<snip>
 

WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"

strInput = WScript.StdIn.Readline

WScript.Echo 
 

If (strInput = "N" or strInput = "n") Then 

	WScript.Quit

ElseIf (strInput = "Y" or strInput = "y") Then

	WScript.Echo "Installing updates..."
 
 

</snip>

Open in new window

0
Comment
Question by:LarryDAH
2 Comments
 
LVL 31

Accepted Solution

by:
merowinger earned 500 total points
Comment Utility
may it works with a vbscript msgbox


strInput = MsgBox ("Would you like to install updates now? (Yes/No)",vbYesNo)
 

If strInput = vbNo Then

	WScript.Quit

ElseIf strInput = vbYes Then

	WScript.Echo "Installing updates..."

Else

	WScript.Echo "Anything else"

End If

Open in new window

0
 

Author Comment

by:LarryDAH
Comment Utility
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now