Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query bios for asset tag

Status
Not open for further replies.

lewwy

Programmer
Apr 10, 2011
1
AU
Hi All,

I want to know if I can use qBASIC to query a computer to get the serial number and asset tag. I know this can be done in windows by use of the WMI but I want to use it in DOS.

The computer I'm trying this on is a DELL OptiPlex 780.

Thanks!

Lewis
 
Because DOS has no registry acces, a DOS program (qbasic) can access it either - at least not gracefully. Although, you can always run SHELL to execute DOS registry tools, like REG, and send the output to a file which can be opened and read in qbasic.

Example
Code:
SHELL "REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName > computername.txt"

OPEN "computername.txt" FOR INPUT AS #1
   GET #1, regPath$
   GET #1, regValue$, regType$, regData$
CLOSE #1

PRINT "The name of this computer is" + regData$

Quick REG reference.

-Geates

NOTE: It has been years, if not a decade, since I have programmed in qbasic. Some syntax may be incorrect.


In the voice of the Dos Equis Most Interesting Man in the World: "I don't always test my code. But when I do, I do it in production
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top