Use the Query option and pipe it to the findstr command.
schtasks /query /V /FO CSV | findstr "shutdown.exe"
Can probably put that into a for loop to get the correct token as well.
Search found 4332 matches
- 09 Jan 2012 14:34
- Forum: DOS Batch Forum
- Topic: schtasks - checking for shutdown.exe and overwrite
- Replies: 15
- Views: 20229
- 08 Jan 2012 13:46
- Forum: DOS Batch Forum
- Topic: 2 pushd one for temp and one for location where file is
- Replies: 4
- Views: 5435
Re: 2 pushd one for temp and one for location where file is
What do you mean you won't know. You just echoed the output to whatever directory is assigned to the temp variable because you did the pushd first so use the temp variable with the set statement. Set /p nick=<%temp%\nick.db Word of advice to you. Make sure you close up the spaces when you are using ...
- 08 Jan 2012 13:03
- Forum: DOS Batch Forum
- Topic: 2 pushd one for temp and one for location where file is
- Replies: 4
- Views: 5435
Re: 2 pushd one for temp and one for location where file is
you know you can use the full path to the filename.
- 08 Jan 2012 11:57
- Forum: DOS Batch Forum
- Topic: Specify which line to read in "Findstr"
- Replies: 4
- Views: 10381
Re: Specify which line to read in "Findstr"
It might actually help if you could post an example of your input and what you expect the output to be.
- 07 Jan 2012 21:26
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
I think I can use Judago's Divide.bat
http://judago.webs.com/content/Scripts/divide.txt
http://judago.webs.com/content/Scripts/divide.txt
- 06 Jan 2012 17:03
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
Wow Dave, you really outdid yourself. That is like instantaneous output on a 1.2GB file. Now I just need to Divide the Line Length into the File size and that should give the total lines. I would have never thought of using FC and FINDSTR that way. In fact I just used FC for the first time just a fe...
- 06 Jan 2012 10:31
- Forum: DOS Batch Forum
- Topic: Drawing rudimentary graphics in text mode
- Replies: 46
- Views: 74721
Re: Drawing rudimentary graphics in text mode
This is some cool stuff. Didn't realize you could change the color like that. I always assumed it was an all or nothing.
- 06 Jan 2012 06:04
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
Dave I do see your point though on the last line not having an EOL. My math will not work if that happens.
- 06 Jan 2012 05:47
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
Hi Alan, Thanks for your input but I got that covered as well. A missing EOL on the last line does not affect a ftp upload to our mainframe. No big deal at all. Now I can say that in 15 years of working in this job I have not seen mixed EOL but I have already seen it talked about on this forum. That...
- 05 Jan 2012 15:04
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
I haven't ran into a file yet that this hasn't worked on. The Majority of time our clients send in clean fixed length data so it should work.
I should put in a check when doing the modulus for the EOF check. If it is Greater than 1 then we know there is something wrong with the file.
I should put in a check when doing the modulus for the EOF check. If it is Greater than 1 then we know there is something wrong with the file.
- 05 Jan 2012 11:29
- Forum: DOS Batch Forum
- Topic: Problem with set /A
- Replies: 4
- Views: 5861
Re: Problem with set /A
Missing a Carrot before the first pipe.
- 04 Jan 2012 15:03
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
Something different. @echo off ::Determine file size set "fSize=%~z1" for /f "delims=" %%a in ('findstr /n . "%~1" ^|findstr "^1:"') do call :strlen "%%~a" len & goto :break :break for /f "tokens=2 delims=:" %%L in ('findstr /n /o "...
- 04 Jan 2012 12:51
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
OK - I've got the ultimate text file attribute probe It measures everything directly - it does not do any math based on assumptions. It is able to process a 250MB file in 16 seconds. Ok your computer must be exponentially faster than mine. 30 seconds each. E:\batch files\HEAD>FileAttributes.bat EOF...
- 04 Jan 2012 12:30
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
Some more output using EOF this time. This one seems to be OK with the LF and an EOF. My biggest concern was that it took close to 20 seconds for each of these two tests. But overall this should still be quicker than using FIND. E:\batch files\HEAD>DaveLength.bat EOF_CRLF.txt fSize=63016885 lnCnt=25...
- 04 Jan 2012 11:57
- Forum: DOS Batch Forum
- Topic: Determining the number of lines in a file.
- Replies: 50
- Views: 56540
Re: Determining the number of lines in a file.
Here is some output. Using the Same input file. One with CRLF and one with just an LF. I am getting the output that I really need, but not sure why the last two variables come back as undefined when the file has a LF for the EOL. Getting back the correct Line Count, Line Length and EOL Size is reall...