PC Review


Reply
Thread Tools Rate Thread

batch commands work in Win XP but not 98

 
 
Eric Anderson
Guest
Posts: n/a
 
      3rd Mar 2008
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
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      3rd Mar 2008

"Eric Anderson" <(E-Mail Removed)> wrote in message
news:af3c6627-67b5-4bb4-9e09-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Eric Anderson
Guest
Posts: n/a
 
      4th Mar 2008
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-(E-Mail Removed)...
>
>
>
>
>
> > 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.
 
Reply With Quote
 
VanguardLH
Guest
Posts: n/a
 
      4th Mar 2008
"Eric Anderson" wrote in message
news:42853447-8fab-4f4a-963b-(E-Mail Removed)...
>
> "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.

 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      4th Mar 2008
<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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch commands & Ms-Access Selva Chinnasamy Microsoft VB .NET 12 19th Dec 2005 02:32 AM
Windows2000 and DOS batch commands Justsometechguy Microsoft Windows 2000 2 18th Aug 2004 11:55 PM
FTP commands from batch file Michael Lawson Microsoft Windows 2000 1 13th Aug 2004 01:31 AM
Batch commands neil@dms Microsoft Windows 2000 2 29th Apr 2004 04:11 AM
Using batch commands in win 98 GeorgeMar Microsoft Access VBA Modules 7 25th Feb 2004 09:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:28 AM.