Click here for important information about

Solved Searching variables in a batch file

July 5, 2012 at 07:47:37
Specs: Windows 7
What I basically want to do is to search all the variables, or specified variables, for a cirtant word, letter or number. I know this can be easily done with an SQL database file but I'm trying to keep everything in one file. So again, just like searching for information in a database I want to search variables for a word, and if they contain that word, I want the file to display the variable(s) that match the search parameters. I know it can be done but I can't find how to do it.

See More: Searching variables in a batch file

July 5, 2012 at 10:40:44
✔ Best Answer
If, by "variables", you mean system (environment) or batch var.s, then:
set | find /i pattern

set | findstr /i /G patternfile

if you want to search text file or multiple files, use findstr (see: findstr /?)

Report •

July 5, 2012 at 14:20:55
set command will also wild card.

for example if you were looking for a declared variable

hamster with a value of 500

and you used
set ham
it will display

:: mike

Report •
Related Solutions

Ask Question