Script That Runs a WMIC Command Runs Slowly, and You Cannot Specify a Custom Timeout Value for the WMIC /FAILFAST Switch (824223)



The information in this article applies to:

  • Microsoft Windows Server 2003, Datacenter Edition
  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Home Edition

SYMPTOMS

In Microsoft Windows XP, when you run a script that contains Microsoft Windows Management Instrumentation Command-line (WMIC) commands that are issued to target computers, the script runs slowly and may pause for several minutes if the WMIC /FAILFAST switch is set to ON (/FAILFAST:ON).

In Microsoft Windows Server 2003, when you run a script that contains WMIC commands that are issued to target computers, you cannot change the default five-second timeout value for the target node to respond to a ping request. For example, you may want to change the ping timeout value if you have computers that must respond over slow wide area network (WAN) links. Or, if you have a high-speed network, you may want to change the ping timeout value because you do not want to wait five seconds for the ping timeout if the target node is unavailable.

CAUSE

This problem occurs in Windows XP because, if the /FAILFAST switch set to ON, the WMIC command does not try to ping the target node to see if the target is available. Instead, WMIC retrieves host information (by using the gethostbyname method or the gethostbyaddr method) about the target only from a name service provider, such as Domain Name System (DNS) or Windows Internet Name Service (WINS). If the host name resolves, the WMIC command is tried even if the target node is not available. This process causes delays in the command output.

In Windows Server 2003, when a WMIC command with the /FAILFAST switch set to ON is issued, a ping is sent to the target node. However, if a reply is not received within five seconds, the remainder of the command is aborted.

RESOLUTION

Windows XP service pack information

To resolve this problem, obtain the latest service pack for Microsoft Windows XP. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

322389 How to obtain the latest Windows XP service pack

Hotfix information

To resolve this problem, install the hotfix that is described in this article. After you install this hotfix, you can specify a custom timeout value for the /FAILFAST switch in Windows XP and in Windows Server 2003. This hotfix also allows the WMIC command to ping the target nodes in Windows XP.A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows Server 2003 or Windows XP service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

File information

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel. Windows Server 2003

   Date         Time   Version     Size     File name
   --------------------------------------------------
   24-Jul-2003  07:54  5.1.3603.0  346,624  Wmic.exe

Windows XP

Date         Time   Version        Size     File name
-----------------------------------------------------
24-Jul-2003  07:24  5.1.2600.1251  329,728  Wmic.exe

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Windows XP This problem was first corrected in Microsoft Windows XP Service Pack 2.

MORE INFORMATION

The WMIC utility (Wmic.exe), is used to access Windows Management Instrumentation (WMI). Before this hotfix, the WMIC /FAILFAST switch accepted only two values: ON and OFF.

After you install this hotfix, you can also specify a custom timeout value (in milliseconds) for the /FAILFAST switch to use. If you specify a shorter timeout value, WMIC commands do not have to wait as long for a target node to respond to the ping that is issued by a WMIC command. For example, you can use /FAILFAST:1000 to give the target node only one second to respond to the ping request.

The new format for this command-line switch is as follows:

/FAILFAST:{ON|OFF|milliseconds}

Examples: /FAILFAST:ON or /FAILFAST:OFF or /FAILFAST:1000.

For additional information about WMIC, click the following article number to view the article in the Microsoft Knowledge Base:

290216 A Description of the Windows Management Instrumentation (WMI) Command-Line Utility (Wmic.exe)


Modification Type:MinorLast Reviewed:10/27/2005
Keywords:kbHotfixServer kbQFE kbWinXPsp2fix kbWinXPpreSP2fix kbBug kbfix kbQFE kbWinServ2003preSP1fix KB824223 kbAudITPRO