Reputation: 9836
I have the following code:
@echo off
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"OS Manufacturer" /C:"OS Configuration" /C:"OS Build Type" /C:"Original Install Date" /C:"System Boot Time" /C:"System Manufacturer" /C:"System Model" /C:"System Type" /C:"Processor(s)" /C:"BIOS Version" /C:"Windows Directory" /C:"System Directory" /C:"Boot Device" /C:"System Locale" /C:"Input Locale" /C:"Total Physical Memory" /C:"Available Physical Memory" /C:"Virtual Memory: Max Size" /C:"Virtual Memory: Available" /C:"Virtual Memory: In Use" /C:"Domain" /C:"Network Card(s)"
echo %a%
echo %b%
echo %c%
pause
Is it possible to write the result of the code above to a text file called result.txt the text file is in the same directory as the batch file? When I say result I mean what it displays. Does anyone know a code I could use?
EDIT: This is only a section of the code the full thing does have a / b /c set to something.
Upvotes: 0
Views: 187
Reputation: 70951
@echo off
setlocal enableextensions
(
systeminfo | findstr ....
echo %a%
echo %b%
echo %c%
) > "%~dp0\result.txt"
Where %~dp0
is the drive and path of the current batch file.
Upvotes: 3