Want I need to do is write a script that will queue WMIC to retrieve both the Model# and Serial# of the machine and display it in a pretty neat fashion (in a nutshell, I plan on doing much more with it later)
So far
Code: Select all
@echo off
for /F "tokens=*" %%a in ('wmic csproduct get name') do set model=%%a
for /F "tokens=*" %%b in ('wmic bios get serialnumber') do set serial=%%b
echo %serial% and %model%
pause
This alone is only displaying an output of " and "
Anyone know why that is? Is there some anomaly behind WMIC when trying to capture the output? Even if I redirect the output to a text file, then try to import the text file and make it a variable, it doesn't work correctly.
For the record, I'm a total noob with for /F so I may have completely destroyed the code here, I was assuming %%a was the first variable and I could set %%b to be the second variable.
As always, Thanks a million!