Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7164915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:09:15+00:00 2026-05-28T14:09:15+00:00

I’m a relatively inexperienced coder and I’ve been running into an issue with getting

  • 0

I’m a relatively inexperienced coder and I’ve been running into an issue with getting the physical disk serial number remotely via a VBScript.

Currently I’m using the default script in Scriptomatic V2, by the Scripting Guys. I’m running it from a 2003 Server and trying to get info from Win2000 and WinXP SP2/SP3 systems. I’ve seen from a couple tutorials that the WMI class recommended is Win32_PhysicalMedia.

Including the useful bits:

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("STN_XP","STN_2000")
  For Each strComputer In arrComputers
    WScript.Echo
    WScript.Echo "=========================================="
    WScript.Echo "Computer: " & strComputer
    WScript.Echo "=========================================="

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia", "WQL", _
                                      wbemFlagReturnImmediately + wbemFlagForwardOnly)

    For Each objItem In colItems
      '(Removed a couple from the code, just showing the useful ones)
      WScript.Echo "Model: " & objItem.Model
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "SerialNumber: " & objItem.SerialNumber
      WScript.Echo "Tag: " & objItem.Tag
      WScript.Echo
      Next
    Next

Now the output I get is below: Note this is the exact output from running the script with all calls; no data is returned beyond the objItem.Tag value:

==========================================
Computer: STN_XP
==========================================
Capacity:
Caption:
CleanerMedia:
CreationClassName:
Description:
HotSwappable:
Manufacturer:
MediaDescription:
MediaType:
Model:
Name:
OtherIdentifyingInfo:
PartNumber:
PoweredOn:
Removable:
Replaceable:
SerialNumber:
SKU:
Status:
Tag: \\.\PHYSICALDRIVE0
Version:
WriteProtectOn:

==========================================
Computer: STN_2000
==========================================

All computers are connected to a domain, I’m logged in to the primary admin account. Using some of the other WMI libraries, I get data, and on one specific computer so far I’ve received a serial number (and tag, but nothing else). I’ve read up on this being an issue for Vista, where you are required to run in admin mode. This shouldn’t be an issue here, due to the OSes in use. Anyone know what might be wrong?

As a follow-up question, does anyone know how to get the Serial Number from a 2000 station?

Thanks in advance for any help you can give me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:09:16+00:00Added an answer on May 28, 2026 at 2:09 pm

    Comment out the On Error Resume Next with a single quote, and post the error message that is likely being returned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.