Page 1 of 1

Help with batch code- need help!

Posted: 12 Oct 2011 00:11
by Rileyh
Hi,
I am having trouble with the "find" command. I need it to ask for an input, and then the program searches for the input in a text document.
Here is the code:

Code: Select all

set /p b=Input:
find /C /I "%b%" %dir%\test\%user%\%userconfig.txt
if %errorlevel% 0 (goto :pass)


Could someone please post a resolution?

Regards,
Rileyh

Re: Help with batch code- need help!

Posted: 12 Oct 2011 07:33
by !k
what is %dir%\test\%user%\%userconfig.txt ?

Re: Help with batch code- need help!

Posted: 19 Oct 2011 18:45
by Rileyh
!k,
It is a file path that the user specifies. Each variable in the filepath is a directory or subdirectory.
Sorry about the multiple errors in the filepath variables.

Rileyh