i need help with variable of set /p

Hewlett-packard Pavilion dv6-2190us note...
January 22, 2011 at 09:48:46
Specs: Vista, Core 2 / 2 gig ram

this is basically what i want it to look like


echo please specify a book you want to read by typing in a letter

if exist .\Genesis.txt echo A) Genesis
if exist .\Exodus.txt echo B) Exodus

set /p biblebook=
if %biblebook% == a goto 1
if %biblebook% == b goto 2


:1
echo Genesis >> Genesis.temp
set /p biblebk= < genesis.temp

:2
(same as 1)


basically i want the ability to make "A" become a certain variable with set /
but i don't know how


See More: i need help with variable of set /p

Report •


#1
January 22, 2011 at 13:01:18
not sure what exactly you are loooking for however try this.

echo please specify a book you want to read by typing in a letter

if exist .\Genesis.txt echo A) Genesis
if exist .\Exodus.txt echo B) Exodus

set /p biblebook=
if %biblebook% == a (
do all your stuff here
)
if %biblebook% == b (
DO all your stuff for B here
)


:: To set a variable you can directly put Set variable_name=Value after IF commands (Where i wrote "Put all stuff here".

The more info you provide the more help you will get.

Subhash Chandra.
www.s-chandra.co.cc


Report •

#2
January 22, 2011 at 13:31:32
never mind i figured it out :P

echo off
cls
title -==Bible implementor 1.04==-
echo welcome to the bible implementor

if exist .\ echo A) Genesis
if exist .\ echo B) Exodus
set /p biblebook=
if %biblebook% == a goto 1
if %biblebook% == b goto 2

:1

set biblebk=genesis
goto final

:2
set biblebk=exodus
goto final


:final
set /p find= what do you wish to find:


find /i "%find%" "C:\%biblebk%.txt


pause


this is the code
if you can come up with something shorter please tell me


Report •

#3
January 23, 2011 at 09:24:00
echo off
cls
title -==Bible implementor 1.04==-
echo welcome to the bible implementor

if exist .\ echo A) Genesis
if exist .\ echo B) Exodus
set /p biblebook=
if %biblebook% == a (
set biblebk=genesis
goto Final)

if %biblebook% == b (
set biblebk=exodus
goto final
)
:final
set /p find= what do you wish to find:

find /i "%find%" "C:\%biblebk%.txt


pause

Subhash Chandra.
www.s-chandra.co.cc


Report •

Related Solutions

#4
January 23, 2011 at 14:17:05
thanks :) that helps

Report •


Ask Question