Batch export line to .txt

Microsoft Windows xp professional w/serv...
July 14, 2010 at 04:02:38
Specs: Windows XP SP3
I'm wanting to make a simple batch or vbs file that exports a line from the results of the command to a text file.

Command:
wmic bios get serialnumber

Results:
SerialNumber
Myserialnumber

I only want the "Myserialnumber" value exported to the .txt.

Thanks!


See More: Batch export line to .txt

Report •


#1
July 14, 2010 at 05:27:10
How about:

FOR /F "skip=1" %%a IN ('WMIC BIOS get SerialNumber') DO (
    ECHO %%a >>Serial.Number.txt
)

When your only tool is a hammer, every problem looks like a nail.


Report •

#2
July 14, 2010 at 06:06:45
That did the trick.. thanks!

Report •

#3
November 15, 2010 at 14:55:13
Now suppose that I want to set that serial number as a variable?

Report •
Related Solutions


Ask Question