|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help with script to do net time and validate time and output file
I am using a for /f %i in (listservers.txt) do net time \\%1 and it does the net time for all the servers in that text file. I am trying to pipe findstr and search for 1 the first digital in the time column and output it to a file. This output file lists servers that have the time change due to DST. I need help on how I would use findstr on the same line or subroutine to search for the first digital in the time. I tried doing this for /f %i in (listservers.txt) do net time \\%1 |findstr "1:" >output.txt but it did not work. I am thinking someone might have a different idea. Thanks, Steve Steve,
This seems to work for me once I changed the redirect >output.txt to >>output.txt. Let us know exactly what you are seeing if this doesn't help.SlowBob Show quote "Steve" wrote: > > All, > > I am using a for /f %i in (listservers.txt) do net time \\%1 and it does the > net time for all the servers in that text file. I am trying to pipe findstr > and search for 1 the first digital in the time column and output it to a > file. This output file lists servers that have the time change due to DST. > > I need help on how I would use findstr on the same line or subroutine to > search for the first digital in the time. > > I tried doing this > > for /f %i in (listservers.txt) do net time \\%1 |findstr "1:" >output.txt > > but it did not work. > > I am thinking someone might have a different idea. > > Thanks, > > Steve Thanks, it worked.
Show quote "SlowBob" wrote: > Steve, > > This seems to work for me once I changed the redirect >output.txt to > >>output.txt. > > Let us know exactly what you are seeing if this doesn't help. > > SlowBob > > "Steve" wrote: > > > > > All, > > > > I am using a for /f %i in (listservers.txt) do net time \\%1 and it does the > > net time for all the servers in that text file. I am trying to pipe findstr > > and search for 1 the first digital in the time column and output it to a > > file. This output file lists servers that have the time change due to DST. > > > > I need help on how I would use findstr on the same line or subroutine to > > search for the first digital in the time. > > > > I tried doing this > > > > for /f %i in (listservers.txt) do net time \\%1 |findstr "1:" >output.txt > > > > but it did not work. > > > > I am thinking someone might have a different idea. > > > > Thanks, > > > > Steve |
|||||||||||||||||||||||