Skip navigation

Windows Tips & Tricks UPDATE--June 20, 2005

Windows Tips &amp Tricks UPDATE, June 20, 2005, —brought to you by the Windows IT Pro Network and the Windows 2000 FAQ site

Make sure your copy of Windows Tips & Tricks UPDATE isn't mistakenly blocked by antispam software! Be sure to add [email protected] to your list of allowed senders and contacts.

This email newsletter comes to you free and is supported by the following advertisers, which offer products and services in which you might be interested. Please take a moment to visit these advertisers' Web sites and show your support for Windows Tips & Tricks UPDATE.

The Final Days are Here, Make the Switch Before it's too Late!


Sponsor: The Final Days are Here, Make the Switch Before it's too Late!

If you are using an Internet filtering solution other than iPrism from St. Bernard, there has never been a better time to make a switch. Until June 30th, you can get great savings by switching to the award-winning iPrism Web filtering appliance. iPrism is a true hardware solution that's easy-to-install and administer and has a very low total cost of ownership. Don't delay, make the switch to better performance today and save! Plus, find out more by downloading iPrism's FREE TOOLS!


  • Q. How can I use a script to determine a machine's OS version?
  • Q. What's Windows XP N?
  • Q. What's port 445 used for in Windows 2000 and later versions?
  • Q. How can I disable NetBIOS over TCP/IP (NetBT)?
  • Q. How can I send an email message from within a VBScript script?

by John Savill, FAQ Editor, [email protected]

In this issue, I tell you how to use a script to determine a machine's OS version. I explain what Windows XP N is and what port 445 is used for in Windows 2000 and later versions. I also outline how to disable NetBIOS over TCP/IP (NetBT) and how to send an email message from within a VBScript script.


Network Testing Labs, one of the world's leading independent research companies, concluded that "Argent's suite had a smaller footprint, was more scalable, supported more platforms, had a more responsive and intuitive user interface and gave us more useful reports," the report says. "Argent's suite of monitoring products emerged from our testing with flying colors." Download this FREE Comparison Paper now:


Q. How can I use a script to determine a machine's OS version?

A. You can use Windows Management Instrumentation (WMI) to query the OperatingSystem information on the local machine. To do so, run the following script, which you can download at

  strComputer = "."  Set WshShell = WScript.CreateObject("WScript.Shell")  Dim WshShell  Set objWMIService = GetObject("winmgmts:" &_      "\{impersonationLevel=impersonate\}!\\" & strComputer & _     "\root\cimv2")  Set colOperatingSystems = objWMIService.ExecQuery ("Select * from _     Win32_OperatingSystem")  For Each objOperatingSystem in colOperatingSystems    if objOperatingSystem.Caption = "Microsoft Windows 2000_     Professional"  then wscript.echo "2000"    if objOperatingSystem.Caption = "Microsoft Windows XP _     Professional"  then wscript.echo "XP"  Next  

You can modify the script to perform various other actions and add other OSs by adding more "if" clauses. You can determine the name of other OSs by running the following script, which you can download at, on the local machine:

  strComputer = "."  Set WshShell = WScript.CreateObject("WScript.Shell")  Dim WshShell  Set objWMIService = GetObject("winmgmts:" & _     "\{impersonationLevel=impersonate\}!\\" & strComputer & _     "\root\cimv2")  Set colOperatingSystems = objWMIService.ExecQuery ("Select * from _     Win32_OperatingSystem")  For Each objOperatingSystem in colOperatingSystems    wscript.echo objOperatingSystem.Caption  Next    

If you run the script on a machine that uses Windows Server 2003, Standard Edition, for example, you'll see output similar to that which the figure shows. Thus, to determine whether the machine is running Windows 2003 Standard, you add the following line to the OS check portion of the main script:

  if objOperatingSystem.Caption = "Microsoft(R) Windows(R) _     Server 2003, Standard Edition "  then wscript.echo "2003 Std"  

Q. What's Windows XP N?

A. As part of the European Union (EU) and Microsoft antitrust settlement, Microsoft had to create versions of Windows XP Professional Edition and Windows XP Home Edition that don't include Windows Media Player (WMP). These versions are called XP Professional Edition N and XP Home Edition N and are available only in Europe. You can find more information about the products at .

Q. What's port 445 used for in Windows 2000 and later versions?

A. In pre-Win2K versions of Windows, the Server Message Block (SMB) protocol runs over NetBIOS, which in turn can run over TCP/IP. This combination of NetBIOS over TCP/IP is known as NetBT and uses UDP ports 137 and 138 and TCP port 139. Win2K introduced the ability to run SMB directly over TCP/IP without the NetBIOS layer. This new direct TCP/IP SMB runs over port 445 and is the preferred method for running SMB. By default, Win2K and later use SMB over TCP/IP rather than over NetBT whenever possible. However, if NetBIOS over TCP/IP is enabled and an SMB query to port 445 fails (meaning the target computer doesn't support SMB over TCP/IP), the system will use the older SMB over NetBT. You can use the Netstat command to check the status of ports in use. To do so, open a command line and type

  netstat -an    

The -an switch shows all listening ports in numeric format. The output will show which ports are listening. If only port 445 is listening, NetBT is disabled. If ports 137, 138, and 139 are also listening, NetBT is enabled, as the following output shows:

Active Connections

Proto Local Address Foreign Address State TCP LISTENING TCP LISTENING UDP *:* UDP *:* UDP *:*

Q. How can I disable NetBIOS over TCP/IP (NetBT)?

A. NetBT isn't always desirable because of its use of NetBIOS, and Windows 2000 and later versions let you run Server Message Block (SMB) directly over TCP/IP. Therefore, after your network is free of legacy machines (older than Win2K), you can disable NetBT. To do so on a per-adapter basis, perform these steps:

  1. Open the adapter for which you want to disable NetBT (Start, Settings, Network Connections, Adapter) and click the General tab.
  2. Select the Internet Protocol (TCP/IP) and click Properties.
  3. Click the WINS tab.
  4. Under "NetBIOS setting," select "Disable NetBIOS over TCP/IP" and click OK.
  5. Click OK twice more to close all dialog boxes.

If you're using DHCP, you can disable NetBT by enabling the option "001 Microsoft Disable Netbios Option," as the figure shows, to avoid having to make the change on a per-computer basis. You also need to ensure that clients are configured with the default "Use NetBIOS setting from the DHCP server" setting enabled by using the previous instructions but in step 4, select "Use NetBIOS setting from the DHCP server."

Remember that disabling NetBT will stop file and printer sharing communications with pre-Win2K machines.

Q. How can I send an email message from within a VBScript script?

A. If you have Microsoft IIS with SMTP installed on a server, you can use the following code to send a basic email message from within a script:

  Set objMessage = CreateObject("CDO.Message")   objMessage.Subject = "Subject"  objMessage.Sender = "[email protected]"  objMessage.To = "[email protected]"  objMessage.TextBody = "Your identity is compromised."  objMessage.Send  
(Substitute your own email information and message text.) You can insert this code into any script that requires a message to be sent.

Events and Resources
(A complete Web and live events directory brought to you by Windows IT Pro: )

  • Antispam Product not Working?

  • Many email administrators are experiencing increased frustration with their current antispam products as they battle new and more dangerous email threats. In-house software, appliances and even some services may no longer work effectively, require too much IT staff time to update and maintain, or satisfy the needs of different users. In this free Web seminar, learn how you can search for a better way to protect your email systems and users.

  • Back By Popular Demand - SQL Server 2005 Roadshow in a City Near You

  • Get the facts about migrating to SQL Server 2005. SQL Server experts will present real-world information about administration, development, and business intelligence to help you implement a best-practices migration to SQL Server 2005 and improve your database computing environment. Attend and receive a 1-year membership to PASS and 1-year subscription to SQL Server Magazine. Register now!

  • Token Authentication: Getting It Right

  • Perhaps you need tokens for management or mobile workers or your only applications that need token support are VPN, extranet access, or PC security. In this free Web seminar, join industry guru Randy Franklin Smith and learn how you can make a solid business case to management that justifies tokens. You’ll also discover what the right combination of token devices and middleware can do? Plus - receive checklists of key evaluation and testing points for rollout time. Register now!

  • Recover Your Active Directory

  • Get answers to all your Active Directory recovery questions here! Join industry guru Darren Mar-Elia in this free Web Seminar and discover how to use native recovery tools and methods, how to implement a lag site to delay replication, limitations to native recovery approaches and more. Learn how you can develop an effective AD backup strategy – Register today!

  • The Essential Guide to Exchange Preventative Maintenance

  • Database health is the weakest link in most Microsoft Exchange Server environments. Download this Essential Guide now and find out how the ideal solution is an automated, end-to-end maintenance and management tool that provides a centralized view of the entire managed infrastructure. Get your free copy now!

    Featured White Paper
    (from Windows IT Pro and its partners)

  • Avoiding Availability Pitfalls in Microsoft Exchange Environments

  • Many solutions are targeted at making Exchange email environments more reliable, however a wide range of potential difficulties still lurk, waiting to interrupt service and, ultimately, your business. In this free white paper, discover the more common pitfalls that can lessen Exchange availability and the recommendations for what you can do to avoid the problem and better plan your Microsoft Exchange messaging environment.

    (from Windows IT Pro and its partners)

  • Why Do You Need the Windows IT Pro Master CD?

  • There are three good reasons to order our latest Windows IT Pro Master CD. One, because it's lightning-fast, portable tool that let you search for solutions by topic, author, or issue. Two, because it includes our Top 100 Windows IT Pro Tips. Three, because you'll also receive exclusive, subscriber-only access to our entire online article database. Click here to discover even more reasons:

  • Monthly Online Pass = Quick Windows Answers!

  • Sign up today for your Monthly Online Pass and get 24/7 access to the entire online Windows IT Pro article database, including exclusive subscriber-only content. That's a database of over 9,000 Windows articles to help you get all the answers you need, when you need them. Sign up now for just US$5.95 per month:

    Sponsored Link

  • Quest Software

  • Eleven things you must know about quick AD recovery!;17412125;8214395;c?

    Contact Us
    Here's how to reach us with your comments and questions:

    This email newsletter is brought to you by Windows IT Pro, the leading publication for IT professionals deploying Windows and related technologies. Subscribe today.

    Hide comments


    • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

    Plain text

    • No HTML tags allowed.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Lines and paragraphs break automatically.