Lee
Mon Mar 03 22:41:37 PST 2008
On Mar 3, 6:16=A0pm, eganders <egand...@yahoo.com> wrote:
> On Mar 3, 7:52=A0pm, "PCR" <pcr...@netzero.net> wrote:
>
>
>
>
>
> > eganders wrote:
>
> > | Why do the following commands result in garbage stored in tractest.txt=
> > | for Windows 98, but puts the date and time headings into the file
> > | "tracetest.txt" for Windows XP as I want? =A0Can these statements be
> > | changed in some way so that the date and time are stored in the file
> > | properly?
> > |
> > | date >> tracetest.txt < nul
> > | time >> tracetest.txt < nul
>
> > Instead of nul, try to input the ENTER key-- but I don't know how to do
> > it! (Nul, for me, created a monstrosity of a file! No one else should
> > ever try it!)
>
> > Alternatively, look for something here...
http://home7.inet.tele.dk/batfi=
les/batfiles.htm
>
> > But I haven't been able to find it, myself, after 1/2 hour's study!
>
> > | I have a batch file that puts the date and time in the header of a
> > | section of a file prior to running a test. =A0I need to identify the
> > | date and time that the test is run. =A0Each time the test is run, the
> > | date and time are placed in the file and the test and the results are
> > | stored in the file appended to the results of the last test run. =A0Th=
is
> > | works just fine for Windows XP, but creates a long file filled with
> > | garbage characters when either of these statements are run for Windows=
> > | 98.
> > |
> > | microsoft.public.win98.gen_discussion
>
> > --
> > Thanks or Good Luck,
> > There may be humor in this post, and,
> > Naturally, you will not sue,
> > Should things get worse after this,
> > PCR
> > pcr...@netzero.net
>
> Someone suggested
>
> echo %date% >> tracetest.txt
> echo %time% >> tracetest.txt
>
> for Windows XP and it created a much better header of just the date
> and time instead of a bunch of garbage around it.
>
> However, does it work with Windows 98?? =A0I don't have Windows 98
> handy. =A0Can someone try it and let me know if those two statments work
> in Windows 98 without causing it to chock?
>
> Thanks- Hide quoted text -
>
> - Show quoted text -
It will not work in Win98 because neither %date% nor %time% are valid
unless you do some more work to assign them values properly - XP is
likely to do this automatically. Another area of contention is the
proper use of double greater than signs. Only one should be used in
the first line to force the creation of the file tracetest.txt and
then two should be used on the second line to cause the second line of
text to be added to the existing file of the same name. Otherwise the
file gets bigger each time it's run with two redirection markers and
it also never gets cleared out of old values.
It's really not fair asking for help on two lines taken out of context
like that - your answers very much will not be usable unless we know
fully what you are trying to do in toto. Other newsgroups are a much
more viable place to get answers that will work - you will still be
required to reveal your hand so to speak.