Click to Rate and Give Feedback
Tips
Windows Server 2008 simplifies the Disk Management user interface by using one set of dialog boxes and wizards for both partitions and volumes. ...

Read more!

When you create a new GPO in the GPMC, you are given the opportunity to base the new GPO on a starter GPO. Because the settings of the starter GPO are then imported into the new GPO, you can use a starter GPO to define the base configuration settings for a new GPO. Here are the steps you need to follow to create a starter GPO. ...

Read more!

We show you how to use the Get-MailboxStatistics cmdlet to view who last logged in to a mailbox, last logon date and time, and message count. ...

Read more!

Learn how to install Hyper-V on both full and Server Core installations of Windows Server 2008. ...

Read more!

Each mailbox has an Exchange alias and display name associated with it. You can change the Exchange alias in four steps. ...

Read more!

Related Articles

Ever wish Windows PowerShell would launch with a work environment tailored to your needs? Don Jones demonstrates how you can use profiles to customize the Windows PowerShell shell.

Don Jones

TechNet Magazine October 2008

...

Read more!

Discover how you can use disconnected recordsets—virtual database tables—to work around VBScript limitations relating to data-sorting and working with large data sets.

The Microsoft Scripting Guys

TechNet Magazine September 2008

...

Read more!

Don Jones kicks off a four part series that will look at how you can use Windows PowerShell to create a real-world user provisioning script.

Don Jones

TechNet Magazine March 2009

...

Read more!

The Microsoft Scripting Guys create a Windows PowerShell script that provides an easy way to back up, archive, and clear your event log files.

The Microsoft Scripting Guys

TechNet Magazine July 2009

...

Read more!

Discover how to use the Excel.Application automation model for a more powerful way to process data from your servers and take advantage of the analysis and charting tools built into Excel.

The Microsoft Scripting Guys

TechNet Magazine January 2009

...

Read more!

Also by this Author

Joshua Hoffman

TechNet Magazine April 2009

...

Read more!

Joshua Hoffman

TechNet Magazine August 2008

...

Read more!

Joshua Hoffman

TechNet Magazine November 2008

...

Read more!

Joshua Hoffman

TechNet Magazine October 2008

...

Read more!

Joshua Hoffman

TechNet Magazine April 2008

...

Read more!

Popular Articles

Without too much effort, you can deploy a terminal server to host the applications you need in your environment. But there are some important decisions you’ll need to make to ensure your implementation meets user expectations. Greg Shields discusses the various options you have and explains how they will affect you.

Greg Shields

TechNet Magazine January 2009

...

Read more!

Learn how you can implement error-handling in Windows PowerShell.

Don Jones

TechNet Magazine January 2009

...

Read more!

Drivers fail, files get corrupted, disks crash--there are numerous uncontrollable reasons why Windows might fail. But all is not lost. Wes Miller explores the kinds of things that can go wrong in a Windows system, and explains how you can troubleshoot them to get your system working again.

Wes Miller

TechNet Magazine January 2009

...

Read more!

The introduction of Hyper-V makes virtualization an even more compelling solution for IT environments. Get an overview of today’s virtualization market and see how Hyper-V improves the manageability, reliability, and security of virtualization

Rajiv Arunkundram

TechNet Magazine October 2008

...

Read more!

SQL Server 2008 includes a new “eventing” mechanism called SQL Server Extended Events that enables some sophisticated troubleshooting. Get an overview of Extended Events and find out how you can use this new functionality for monitoring and troubleshooting.

Paul S. Randal

TechNet Magazine January 2009

...

Read more!

Our Blog

NAP monitors the health of specified computers when they attempt to connect to a network and includes a number of mechanisms to enforce health requirements. In this article, Geek of All Trades Greg Shields gives readers an overview of these enforcement mechanisms and, as an example, takes a closer look at setting ...

Read more!

Use Windows PowerShell to Manage Virtual Machines Here are a few examples of how you can use Windows PowerShell scripts to manage virtual machines running on a Server Core installation. Note that these scripts are presented as samples and may need to be customized to work in your environment.

Create a New ...

Read more!

Disabling an Unused Part of Group Policy Objects One way to disable a policy is to disable an unused part of the GPO. By disabling part of a policy that isn’t used, the application of GPOs and security will be faster.

Administer Windows Server 2008 Server Core from the Command Prompt ...

Read more!

In the August 2008 issue of TechNet Magazine, Paul Randal wrote an article Top Tips for Effective Database Maintenance.  It was geared toward "involuntary  DBAs" (IT pros who inadvertently wind up responsible for a SQL Server instance).  The article had a great response from our readers so Paul has written another ...

Read more!

Microsoft Forefront is designed to deliver an integrated security solution that makes it much easier to deploy and manage security across an organization’s IT infrastructure. In this, our annual security issue, we feature two articles that describe how Forefront Security protects instant messaging and e-mail.

Protect ...

Read more!

Utility Spotlight RunUpdates.cmd
Joshua Hoffman

Download the code for this article: RunUpdates.exe (160KB)

A great deal of time is often invested in determining the best ways to keep an infrastructure current, and rightfully so. In this month’s Utility Spotlight I take a look at a great way to make sure that desktops are as current as possible from the day they are deployed.
RunUpdates.cmd is a script that comes to us from Michael Murgolo, a Senior Consultant with Microsoft Consulting Services specializing in desktop deployment. RunUpdates.cmd provides an automated framework for integrating hotfixes and updates into an enterprise desktop image.
Traditionally, in order to integrate patches from Microsoft into a desktop build, the process would include downloading the updated executables (either from the Windows®Update Catalog or from the individual update Knowledge Base article or Security Bulletin) and creating a command shell script to run each update in turn with the correct switches for silent installation.
Figure 1 shows an example, processing only one update. Typically, many more are needed once a service pack has been out for some time. The entry consists of five lines: two that log to the console and to a file that execution has begun, one that actually executes the update, and two that log the return code. Manually adding these entries to a script, such as the one shown in the figure, is time consuming and error-prone.
Echo Installing MS05-014: Cumulative security update for Internet Explorer (KB867282)
Echo Installing MS05-014: Cumulative security update for Internet Explorer (KB867282) >> 
%systemroot%\setuplog1.log
M:\Source\XPPro\SP2Hotfixes\WindowsXP-KB867282-x86-ENU.exe /passive /norestart >>
%systemroot%\setuplog1.log
Echo Called M:\Source\XPPro\SP2Hotfixes\WindowsXP-KB867282-x86-ENU.exe, rc=%ERRORLEVEL%
Echo Called M:\Source\XPPro\SP2Hotfixes\WindowsXP-KB867282-x86-ENU.exe, rc=%ERRORLEVEL% >> 
%systemroot%\setuplog1.log
RunUpdates.cmd is a command shell script designed to run all files with an .exe extension in a designated folder and all subfolders. It allows for the use of default command-line switches, but it also provides a way to define other switches for updates that may not use the designated default switches.
Download and copy updates to a build folder Any folder structure can be used to store the updates, with two exceptions. The path to the executable (C:\Source\XPPro\SP2Hotfixes\...) must not exceed the limits of MAX_PATH (it must be less than 260 characters, see Naming a File), and all patches in a single subfolder must use the same command-line switches.
Determining switches The latest Windows updates use the /passive /norestart switches, many older Windows patches use the /q /u /z switches, and many Microsoft® Internet Explorer updates use the /q:a /r:n switches. You can generally determine which switches are required by running the update with a /? parameter.
Updates that do not use the default switches RunUpdates.cmd requires a command-line parameter to specify the default switches to be used when running updates. To run any updates with different switches, create a command shell script called SwitchVar.cmd in the same folder as that update. The contents of this script should be a single line that sets the SWITCHES environment variable. For example, if an update requires the /q /r:n switches, the corresponding SwitchVar.cmd should contain the line:
set SWITCHES=/q /r:n
Adding and removing updates in the build process When patches need to be added or removed from the build process, the update must simply be added or removed from the patch folder tree. Since RunUpdates.cmd will run all executables in the folder tree, no script code needs to be modified to add or remove updates. The only time any script needs to be created is if the update does not use the default switches specified on the RunUpdates.cmd command line. In this case, a simple SwitchVar.cmd script is needed.
Full documentation of the proper usage and syntax for RunUpdates.cmd can be found in the accompanying download on the TechNet Magazine Web site.
RunUpdates.cmd will help ensure that your desktop deployments are always up-to-date, a great addition to any desktop engineer’s toolbox.

Joshua Hoffman is the Technical Editor for TechNet Magazine.
© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker