FOR command question

From: djc (noone_at_nowhere.com)
Date: 04/27/04


Date: Tue, 27 Apr 2004 15:00:13 -0400

I have a batch file that appends to a log file. The file has multiple fields
and uses a ',' as a delimiter. The first 2 fields are %date% and %time%. My
windows 2000 and XP machines fill in these fields fine however my NT4
machines do not. So for all lines from an NT4 machine the first two fields
are blank like so:

, , computername, operating system, other stuff etc..

I use the 'find' and 'for' commands on this log file a lot. However the
results when using FOR get messed up due to the NT4 machines leaving blanks.
Say I want to display only computername field. The token would be 3, which
works fine except for the NT4 lines which return the operating system in
example above.

questions:
1) is there a date and time variable that will work for both NT4 and
2000/XP?

2) Is there a way to tell the FOR command to somehow count the first , as 1
so my tokens don't get off? Or do I need to add a space before the first
comma on every log entry? that seems sloppy.

Any input is appreciated. Thanks.



Relevant Pages

  • Re: FOR command question
    ... However I'm unsure if the above is supported by NT4. ... So for all lines from an NT4 machine the first two fields ... > I use the 'find' and 'for' commands on this log file a lot. ... > so my tokens don't get off? ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Called ServiceBase.Run(), but never receive OnStart()?
    ... settings, most important of which for our purposes is the name of the ... On the machines where this works, I see, in the logfile, the two ... Write a startup message to the log file. ... But you are reading from the registry before you are actually writing to the log file, what's important is to know the time you entered Main and the time at which you are calling Run, the difference between those may not exceed 30 seconds. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Errors Message from Webtrends Firewall Suite
    ... Firewall Suite and Firewall Appliance Analyzer keep track of how many ... records in the log file were dropped due to being out of chronological ... The reason it takes more memory is because whatever setting is entered ... One cause could be when multiple machines record to one log, ...
    (comp.security.firewalls)
  • RE: HIDS solution for NT4 machines
    ... If you can't find a HIDS, then you can always put in a network IPS and use ... it to separate your NT4 servers from the rest of the environment. ... So a network IPS would be a good alternative. ... these machines from zero day exploits, worms, and BO's. ...
    (Focus-IDS)
  • Re: HIDS solution for NT4 machines
    ... What about Snort? ... myself in NT4, but it's definitely worth a test. ... > We did think about putting an IDS/IPS device in front of the NT4 machines or ... > network segment and then game over. ...
    (Focus-IDS)