Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Batch File Problem running programs

Avatar of gjpitt
gjpitt asked on
Microsoft DOS
8 Comments1 Solution418 ViewsLast Modified:
Hi All

We are trying to create a batch file that will bring up a menu of choices to select the type of operation required. It is used on machines without operating systems and relies on an autoexec.bat file to load a Ramdrive and copy various needed files to it and then run the bat file we are having problems with.

The problem file works perfectly if we are only trying to get echo statements to the screen but as soon as we add the calls to run programs it all goes to pot:) and always calls the first choice and does not stop for operator input.

Here is what we are using....

@echo off

:START
ECHO 1. Gdisk (Destroy all data on all drives and partitions)
ECHO 2. Pccheck
ECHO 3. Scandisk 'C' Drv
ECHO 4. Ghost
ECHO 5. Dellsplash (wipes the logo from dell laptops)
ECHO 6. Intel logo removal tool
ECHO 7. Wipe Drive Pro (MOD standard format tool)
ECHO 8. Finish

set choice=
set /p choice= Type the Number to Run the Program.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto Gdisk
if '%choice%'=='2' goto Pccheck
if '%choice%'=='3' goto ScanDisk
if '%choice%'=='4' goto Ghost
if '%choice%'=='5' goto Dsplash
if '%choice%'=='6' goto Intelogo
if '%choice%'=='7' goto Wipedrvp
if '%choice%'=='8' goto End
ECHO "%choice%" is not valid please try again

BEEP

:Gdisk
cls
echo This is GDisk Running
%cdrom%:\gdisk\gdisk.bat
goto start

:Pccheck
cls
echo This is PCCheck Running
%cdrom%:\pccheck\pccheck.exe
goto start

:Scandisk
cls
echo This is Scandisk Running
%cdrom%:\scancdrv\scanc.bat
goto start

:Ghost
cls
echo This is Ghost Running
%cdrom%:\ghost\ghost.bat
goto start

:Dsplash
cls
echo This is Dell Splash Removal Running
%cdrom%:\dsplash\splash.bat
goto start

:Intelogo
cls
echo This is Intel Logo Removal Running
%cdrom%:\intelogo\logo.bat
goto start

:Wipedrvp
cls
ECHO 1. Matt
ECHO 2. Tim
ECHO 3. Gail
ECHO 4. Ian

set choice=
set /p choice=Type the Number to Run the Program.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto matt
if '%choice%'=='2' goto tim
if '%choice%'=='3' goto gail
if '%choice%'=='4' goto ian


:matt
cls
echo This is Matthew Wiping this system
%cdrom%:\wipedrvp\matt\wdpmatt.bat
goto start

:tim
cls
echo This is Timothy Wiping this system
%cdrom%:\wipedrvp\Tim\wdptim.bat
goto start

:gail
cls
echo This is Gail Wiping this system
%cdrom%:\wipedrvp\Gail\wdpgail.bat
goto start

:ian
cls
echo This is Ian Wiping this system
%cdrom%:\wipedrvp\Ian\wdpian.bat
goto start


:end


can you see what we are doing wrong or how to correct it?

Cheers
Graham
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answers