- Code: Select all
@echo off
break off
Title Tony's Command Prompt
color 0a
cls
:cmd
echo Directory: %CD%
set /P CMD=Command:
if "%CMD%" == "cls" goto cls
if "%CMD%" == "home" goto home
if "%CMD%" == "desktop" goto desktop
if "%CMD%" == "a86" goto a86
%CMD%
echo.
goto cmd
:cls
cls
goto cmd
:home
cd %USERPROFILE%
cls
goto cmd
:desktop
cd %SystemDrive%\DOCUME~1\%USERNAME%\Desktop
cls
goto cmd
:a86
cd %SystemDrive%\A86
set /P assemble=Enter assembly file to compile:
if "%assemble%" == *.asm (
if exist "%assemble%" (
a86 "%assemble%"
cls
echo.
echo File successfully compiled!
echo.
pause
goto home
)
if not exist "%assemble%" (
cls
echo.
echo File does not exist.
echo.
goto home
)
else if "%assemble%" == "cls" goto cls
else if "%assemble%" == "home" goto home
else if "%assemble%" == "desktop" goto desktop
else (
cls
echo.
echo Incorrect file type
echo.
pause
goto home
))
Unfortunately, the a86 part is obviously only theoretical. I'm basically trying to make it so that when I type a86; I get a message that tells me to input an asm file. If it's indeed an asm file type and it actually resides within the directory then it should compile the file, show a success message, then go back to the original prompt screen(home). If the file isn't in the provided directory; it shows an error message and returns to the original prompt screen(home).
I hope you can help with my dilemma. I haven't used DOS in years (or a computer for that matter besides my iPod). Also, if you can show me how to create a DOS application in itself that does all of this; that'd be great too. But that's just something extra. I'll be happy enough with the batch menu.