Jump to content

batch commands work in Win XP but not 98


Recommended Posts

Guest Eric Anderson
Posted

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

  • Replies 4
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: batch commands work in Win XP but not 98

 

 

"Eric Anderson" <eganders@yahoo.com> wrote in message

news:af3c6627-67b5-4bb4-9e09-46aa5531d2a4@h25g2000hsf.googlegroups.com...

> 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.

Guest Eric Anderson
Posted

Re: batch commands work in Win XP but not 98

 

Re: batch commands work in Win XP but not 98

 

On Mar 3, 5:12 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:

> "Eric Anderson" <egand...@yahoo.com> wrote in message

>

> news:af3c6627-67b5-4bb4-9e09-46aa5531d2a4@h25g2000hsf.googlegroups.com...

>

>

>

>

>

> > 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.- Hide quoted text -

>

> - Show quoted text -

 

THANKS! Looks MUCH better

 

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

Guest VanguardLH
Posted

Re: batch commands work in Win XP but not 98

 

Re: batch commands work in Win XP but not 98

 

"Eric Anderson" wrote in message

news:42853447-8fab-4f4a-963b-91d78c85f777@s8g2000prg.googlegroups.com...

>

> "Pegasus \(MVP\)" wrote:

>>

>> "Eric Anderson" 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? 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

>>

>> In WinXP a better way would go like this:

>>

>> echo %date% >> tracetest.txt

>> echo %time% >> tracetest.txt

>>

>> It removes the garbage you currently get.

>

> 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.

Guest Pegasus \(MVP\)
Posted

Re: batch commands work in Win XP but not 98

 

Re: batch commands work in Win XP but not 98

 

<snip>

> 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.


×
×
  • Create New...