![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Mar 2007
Posts: 33
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
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.
__________________
"I'm not a genius. Why do I have to suffer?" |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Batch Question | NightShade01 | Other Programming Languages | 3 | Jun 20th, 2006 5:39 PM |
| Embedding a batch file into a C++ app | vynkz | C++ | 22 | May 18th, 2005 8:59 PM |
| Batch Files | Skinner | Other Programming Languages | 4 | Apr 28th, 2005 8:03 AM |
| MSDOS Batch Desktop arrange | dingbat | Other Web Development Languages | 3 | Apr 13th, 2005 5:33 AM |
| MYSQL, pipe delimited or just spaces? | scorpiosage | PHP | 0 | Feb 8th, 2005 3:32 AM |