batch commands work in Win XP but not 98

E

Eric Anderson

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? Can 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

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. I need to identify the
date and time that the test is run. Each 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. This
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.windowsxp.general
 
P

Pegasus \(MVP\)

Eric Anderson said:
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? Can 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

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. I need to identify the
date and time that the test is run. Each 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. This
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.windowsxp.general

Windows 98 batch file commands are much weaker than
WinXP commands. Since this is a Win98 question, the
right place to ask it would be a Windows 98 newsgroup.

In WinXP a better way would go like this:

echo %date% >> tracetest.txt
echo %time% >> tracetest.txt

It removes the garbage you currently get.
 
E

Eric Anderson

Windows 98 batch file commands are much weaker than
WinXP commands. Since this is a Win98 question, the
right place to ask it would be a Windows 98 newsgroup.

In WinXP a better way would go like this:

echo %date% >> tracetest.txt
echo %time% >> tracetest.txt

It removes the garbage you currently get.- Hide quoted text -

- Show quoted text -

THANKS! Looks MUCH better

I will try that with Win98 also just to see if that works.
 
V

VanguardLH

in message
THANKS! Looks MUCH better

I will try that with Win98 also just to see if that works.


--- REPLY SEPARATOR ---
Only required because above poster used QUOTED-PRINTABLE format.
When posting to newsgroups, do NOT use quoted-printable format.
* Not all NNTP clients handle quoted-printable format.
- Some users still use console-mode (non-GUI) NNTP clients.
- The long lines may not wrap properly.
- Scrolling is needed if the long line does not get wrapped.
- The long line may get truncated at the window's width.
- Quoted-printable format uses special character sequences for
logical formatting. View the raw source of your post. Text-
only clients may show that encoding when viewing your post.
* Quoting levels get mangled, especially for multiple replies.
* In replies, there is no clear delineation of content.
- Cannot tell what content is from the original poster and
what is from the respondent.
- Makes impossible to determine who said what when a reply
inserts comments inline with the quoted content.

Because you used quoted-printable format, I had to edit my reply to
show the proper level of indentation to see who said what. That is a
nuisance due to you using an inappropriate format when posting to
Usenet.

Use Google Groups to search for old posts and content within them. Do
NOT use Google Groups for posting to Usenet. Use an NNTP (network
news transfer protocol) client instead.

---[end of comments]---



Won't work in Windows 98. The date and time variables are available
in Windows XP and are not defined in Windows 98. Run 'set /?' to see
comments on the dynamic variables available under Windows XP.

In Windows 98, 'date' (with no parameters) shows the date. In Windows
XP, 'date' (with no parameters) prompts you to change the date; i.e.,
the internal command-interpreter 'date' command was updated to let you
change the date from the command line.
 
P

Pegasus \(MVP\)

In Windows 98, 'date' (with no parameters) shows the date. In Windows XP,
'date' (with no parameters) prompts you to change the date; i.e., the
internal command-interpreter 'date' command was updated to let you change
the date from the command line.

I think you're missing a couple of points. The OP does not want
to set the date; he wants to write the current date into a text file.
And Windows 98 DID allow the user to change the date from
the command line, same as Windows XP. The big difference
between Win98 and WinXP is the lack of the %date% variable
in Win98.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top