1.

Solve : Next?

Answer»

Hello,

I would like to create a batch that finds the first FILE on the computer sets it as a variable then run a program with it then find the next file and start all over again. Like this:

find filepath
set filepath=source
md5 %source%
:start
find nextfile
set nextfile=source
md5 %source%
goto start

Thank You

AlmnQuote

Hello,

I would like to create a batch that finds the first file on the computer sets it as a variable then run a program with it then find the next file and start all over again. Like this:

find filepath
set filepath=source
md5 %source%
:start
find nextfile
set nextfile=source
md5 %source%
goto start

Thank You

Almn

seems like you want to hash your files with md5.
you can use the fciv command. Download from here http://support.microsoft.com/?kbid=841290
There are examples on how to use it.
Do you want to do this on all files, then recurse subdirectories and keep going? Or all files on the entire computer?

Here is a command to run on all files in the current directory (all in one line):
Code: [SELECT]for /f "delims=" %%a in ('dir /a-d /b') do md5 "%%a"
Here is a command to run on all files in the current directory and recursing all subdirectories:
Code: [Select]for /f "delims=" %%a in ('dir /a-d /b /s') do md5 "%%a"
from what you seem to be doing, you are going to be writing ANOTHER batch to check these md5 with the ones you collected. fciv can save you the time to write the checking module.There is a free microsoft toy - http://www.logparser.com/ that would fit the BILL here, it works against logfiles, the registry and the filesystem. It has a nice clean SQL front end and can output to a myriad of formats.

It is easily called by the command line
Grahamactally I think that I mis-posted my thread, I was using md5 as an example. :-/
So can you give me the FORMAT,I would like to run a few lines to check whether the file has the string computer and key as well as name in it then echo it.
Sorry I mis explained:-[


AlmnI took into consideration that you may have given an unrelated example and answered your question the way you asked it, so my code should still work.
Do you want to do this on all files, then recurse subdirectories and keep going? Or all files on the entire computer?

Here is a command to run on all files in the current directory (all in one line):
Code: [Select]for /f "delims=" %%a in ('dir /a-d /b') do md5 "%%a"
Here is a command to run on all files in the current directory and recursing all subdirectories:
Code: [Select]for /f "delims=" %%a in ('dir /a-d /b /s') do md5 "%%a"


Discussion

No Comment Found