Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Having problem with batch file

Name: Anonymous 2009-03-27 17:51

@echo off

:start

echo.
echo Computer: Which topic do you wish to talk about?

set /p topic=

if %topic%.==. (echo Computer: Don't just press enter without typing anything!) && (echo           I'll ask again.) && (goto start)

FINDSTR /C:"%topic%" responses.bat > NUL || goto unfamiliar
call responses.bat

----------------------------

So that's the start of my code. I'm trying to check for a null string, to make it complain if you just press enter without inputting anything.

It works for just pressing enter - but there's an unfortunate side-effect. If you enter in anything with a space (such as "James bond" , without quotes), it exits. It's not following goto end or anything like that, because I have a pause command right after :end.

I know it's definitely the line with the 'if' that's causing the problems, and not any other line. I think.

Help a noob out?

Name: Anonymous 2009-03-27 18:57

>>5
It's severely hampered by the fact you're still running Windows.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List