![]() |
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 |
If you put [ code ] tags around your source it'll make more pleasant reading. I don't do a lot of work with .BAT files - I'm tempted to say 'get a real shell' but I seem to remember the SET command is quite flexible and useful; maybe you can get the output of the TIME / DATE commands into a variable with it or something like that?
Hopefully this helps. I'm too lazy to investigate further. |
| All times are GMT -5. The time now is 12:20 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC