Help with batch code- need help!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

Help with batch code- need help!

#1 Post by Rileyh » 12 Oct 2011 00:11

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

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: Help with batch code- need help!

#2 Post by !k » 12 Oct 2011 07:33

what is %dir%\test\%user%\%userconfig.txt ?

Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

Re: Help with batch code- need help!

#3 Post by Rileyh » 19 Oct 2011 18:45

!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

Post Reply