Autoexec.bat - TechRepublic
Question
June 9, 2008 at 03:16 PM
dkittle

Autoexec.bat

by dkittle . Updated 18 years, 1 month ago

Im trying to make me a bootable thumb drive.
Which I can..no problem. I want a menu to select from. Im editing the autoexec.bat file here is what i have so far….

@echo off
prompt $p$g

:menu
cls
echo 1.DOS
echo 2.AutoClave
echo 3.Ghost
set /p choice=?:

if “%choice%” == “1” goto DOS
if “%choice%” == “2” goto AutoClave
if “%choice%” == “3” goto Ghost
(echo Error: Invalid choice. && pause) & (goto menu)

:DOS
cd \DOS\AUTOEXEC.BAT
goto exit

:AutoClave
cd \AutoClave\AUTOEXEC.BAT
goto exit

:Ghost
cd \Ghost\AUTOEXEC.BAT
goto exit

:exit

…. most of it work fine execpt it errors out on this line (echo Error: iInvalid choice. && pause) & (goto menu).

The error message reads
“Bad command or file name
invalid directory”

One more thing it runs fine throught the command prompt just not when I boot from a disk. The boot screen look like this…

1.DOS
2.AutoClave
3.Ghost
Bad command or file name
invalid directory
A:\>

Any help would be super Appreciated

This discussion is locked

All Comments