I'm having the below script to display some data on-screen, using one small CMD file:
@echo off
set description=%1
ver
date /t
time /t
echo %description%
This provides output, similar to:
Microsoft Windows [Version 6.1.7601]
ma 08/12/2014
17:00
sometext
But, I would like to have this output:
Microsoft Windows [Version 6.1.7601] [ma 08/12/2014 17:00] sometext
I can't think of easy coding (without including variables and/or temporary files) to have something like that achieved. Is it possible in an easy manner (like using backticks on Linux/Unix) ? How ?
As a bonus, it would be even more better if that one line does not end with a return character. That way, I can add additional text (also in 1 line format) to the file, just using ECHO. Knowing that ECHO itself will add a return eventually. I know I can do this, using Cygwin's PRINTF, but if possible I would like to avoid Cygwin, and use standard CMD.
EDIT: changed the question to include the "ver" command so that it matches the title : output of real commands, to be converted into 1 line