PDA

View Full Version : Batch file help needed



Davefjedi
20th November 2008, 02:53 PM
I want the choice 1 or 2 to start as soon as the button 1 or button 2 are pressed how do I do this see below this is what I have so far
the choice is for 2 different startup options for jukebox software for a mate and his son 2 very diffrent tasts in music
os is winxp sp2
At the moment you need to press enter after making the choice

@echo off
CLS
echo.
echo SHED JUKEBOX FROM HELL
echo.
echo.
echo.
echo Welcome to the "SHED JUKEBOX FROM HELL".
echo
CLS
echo Please choose start up option:
echo.
echo.
echo 1. Stevies Music:
echo.
echo 2. Phillips Music:
echo.
echo.
echo Please choose an option:
pause
set /p choice=Enter a number:
if %choice% == 1 GOTO STEVE
if %choice% == 2 GOTO PHILLIP

:STEVE
c:
cd\jukebox
cd steve
START wincab.exe
GOTO ENND

:PHILLIP
CLS
c:
cd\jukebox
cd phillip
START wincab.exe

:ENND

Brad
20th November 2008, 03:24 PM
Create a text file with the choices in it and have the batch file read the text file. Eg:

echo 1 > answer.txt
echo 2 >> answer.txt
menu.bat < answer.txt

Can't remember the exact syntax though

Brad

headkaze
20th November 2008, 03:59 PM
@echo off
CLS
echo.
echo SHED JUKEBOX FROM HELL
echo.
echo.
echo.
echo Welcome to the "SHED JUKEBOX FROM HELL".
echo
CLS
echo Please choose start up option:
echo.
echo.
echo 1. Stevies Music:
echo.
echo 2. Phillips Music:
echo.
echo.
CHOICE /C 12 /N /M "Please choose an option:"
IF ERRORLEVEL 1 GOTO STEVE
IF ERRORLEVEL 2 GOTO PHILLIP

:STEVE
c:
cd\jukebox
cd steve
START wincab.exe
GOTO ENND

:PHILLIP
CLS
c:
cd\jukebox
cd phillip
START wincab.exe

:ENND

Brad
20th November 2008, 04:14 PM
Yay, even better.

The one I did is for not requiring any entry at all eg: unattended :redface

Brad

Davefjedi
20th November 2008, 04:24 PM
Hmmm CHOICE is not recognised as an internal or external command,operable command or batchfile:unsure

elvis
20th November 2008, 06:52 PM
Hmmm CHOICE is not recognised as an internal or external command,operable command or batchfile:unsure
It's in the reskit (Resource Kit). You can find a matching reskit for your OS on Microsoft's site, or via google.

Davefjedi
20th November 2008, 07:45 PM
It's in the reskit (Resource Kit). You can find a matching reskit for your OS on Microsoft's site, or via google.

:unsure
Im a nooob

elvis
20th November 2008, 08:07 PM
Hrm I was certain it was in the reskit.

The 32bit Windows Server 2003 reskit will work on 32bit Windows XP:
http://www.microsoft.com/downloads/details.aspx?familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en

But it doesn't seem to have the "choice" command in there. I'm confuzzled...

Any Microsoft guys here know where to get it (safely)?

AdamC
20th November 2008, 09:11 PM
What about installing wincab into 2 different directories, and setting each up to use thier own song folders, then use a frontend like MaLa to select which persons music style you want to listen to ?
:unsure

Davefjedi
21st November 2008, 07:22 AM
May need to do that I wanted to keep it simple batch is working just need to push enter to select I was wanting to just have to push 1 or 2 and have it continue on from there

Brootal
21st November 2008, 12:37 PM
choice was in the NT resource kit, not sure about kit's after.

best bet is if you (or someone) has a Dos 6 or 95/98 install it should be in those by default, just copy choice.com over and it should work fine

Davefjedi
21st November 2008, 02:14 PM
choice was in the NT resource kit, not sure about kit's after.

best bet is if you (or someone) has a Dos 6 or 95/98 install it should be in those by default, just copy choice.com over and it should work fine

Yeah I got a copy off of fraggles mame boot cd but it dosent work to well
well looks like I may need to install Delphi and go from there create an executable to do what i want here comes a 7 day project to chose 1 or 2 options:cool:

headkaze
22nd November 2008, 06:02 PM
Here it is

AdamC
22nd November 2008, 07:57 PM
Ahh ,, choiiice maaate :023:

headkaze
23rd November 2008, 08:55 AM
Ahh ,, choiiice maaate :023:

LMAO! Good ol' bogan saying that one. Why don't the youth of today still use it? I mean 'cool' is still around right? Why not choiiiiceee mmaaaatttee! :D

dezbaz
23rd November 2008, 03:30 PM
Thanks for this info guys:jump: