windows - Formating output from bat file -


wmic product name,version > "c:\myinformation.txt" echo.  >> "c:\myinformation.txt" echo %username% >> "c:\myinformation.txt" 

i'm trying write batch file generate software installed on users computer username id purposes. code above works individually. however, when try write out file, †਍敨瑣牯洮牡楴敮⁺਍ instead of "john.doe"

my question is, how can software dump wmic followed username without spitting out garbage. i've flipped order of commands. doing results in getting username not software, in neat output ways.

creating 2 files not want do. i'd 1 file per user.

thanks in advance.

use /append:"myfile.txt" output wmic in file.
i.e.

echo. >"c:\myinformation.txt" wmic /append:"c:\myinformation.txt" product name,version >nul echo.  >> "c:\myinformation.txt" echo %username% >> "c:\myinformation.txt" 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -