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 8532299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:41:03+00:00 2026-06-11T09:41:03+00:00

In wmic, ‘-‘ is special characters. how can use negative number for search? just

  • 0

In wmic, ‘-‘ is special characters.
how can use negative number for search?
just like

wmic volume where serialnumber=-1874012763

because ‘-‘ is sepcial character, this command is not work.

how can i assign negative number for search in wmic?

  • 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-06-11T09:41:05+00:00Added an answer on June 11, 2026 at 9:41 am

    The SerialNumber value from Win32_Volume class is an unsigned integer (uint32), there’s no way to query an unsigned integer value using WMIC since you cannot convert the value, you can only list all values:

    wmic /namespace:\\root\cimv2 path Win32_Volume get SerialNumber /value
    

    As far as I know, you can overcome querying an unsigned integer value by scripting it. For example using VBS quering for an unsigned integer value of ‘-1435665788’ (my systems C drive):

    Option Explicit
    Const SN_VAL=-1435665788
    Dim oWMI, oQRY, oItm, sComp, sMsg
    sComp = "."
    Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & sComp & "\root\cimv2")
    Set oQRY = oWMI.ExecQuery("select * from Win32_Volume") 
    For Each oItm In oQRY 
      If oItm.SerialNumber = SN_VAL Then 
        MsgBox "  DriveLetter: " & oItm.DriveLetter & vbCrLf & _
               " SerialNumber: " & oItm.SerialNumber, vbOkOnly, "WMI Results"
      End If
    Next 
    Set oQRY = Nothing
    Set oWMI = Nothing
    WScript.Quit(0)
    

    The above prompts the drive letter and serial number for the given unsigned integer value. Hope this helps 😉

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

Sidebar

Related Questions

I tried to use wmi to get the hard disk's serial number. What I
How can I get the Manufacturer and the Modal Number of an XP Home
I use wmic mostly as a linux-ps-equivalent in this way: wmic process where (name=java.exe)
I have a Java program which is using WMIC to get certain information about
I try to launch the command prompt hidden when querying the wmic qfe list
This is the command line I want to use inside my VB.NET program. Look
I can not query log Security using WMI. Other logs works fine. Here is
I want to read the name and the serial number of my hard drives.
i am building an Adobe Air App where i can only fetch the drive
I'd like to call a static method via WMI using WQL (basically the equivalent

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.