View Single Post
Old Mar 26th, 2007, 11:12 PM   #1
tAK
Programmer
 
Join Date: Mar 2007
Posts: 33
Rep Power: 0 tAK is on a distinguished road
Batch Pipe command - output formatting

Hey guys,

i have a bat script that runs for whenever a user logs in, it outputs information, in what is close to an ini file format (key=value) with 2 exceptions, being the date and time..

it outputs:
Time=
12:45 PM
Date=
Tue 27/03/2007

Any way to get it to output it as:
Time=12:45 PM
Date=Tue 27/03/2007

the code that currently runs:
Code:

ECHO.Time=>>"c:\Output.txt" time /t>>""c:\Output.txt" ECHO.Date=>>"c:\Output.txt" date /t>>"c:\Output.txt"

i was thinking this should work (to produce the requred format) but it outputs the same as before:
Code:

ECHO.Time=>>"c:\Output.txt" | time /t>>""c:\Output.txt" ECHO.Date=>>"c:\Output.txt" | date /t>>"c:\Output.txt"


any help appreciated.

/tAK
tAK is offline   Reply With Quote