1.

Solve : SImple enough code giving error... any ideas??

Answer»

So if the user types the NAME of the script it should just GO to the start sub method but if they type Help it should give them a help menu

"whatever.bat Help" should go to help menu

"whatever.bat" should just run the program

Code: [Select]echo Off

set Input=%1%
echo %input%
pause
if %Input%== goto :start
if %Input%==Help goto :Help
I get a error message stating "goto was unexpected at this time."

I have tried a couple DIFFERENT combination of codes including :

if %Input%== NULL goto :start

or

if %Input%== {} goto :start

With no avail... anyone got any ideas of what I am doing wrong or what I could do to make it WORK right?

ThanksThanks to whomever sent me a message here is the code that worked:

Code: [Select]IF "%1"=="" goto :CONTINUE

set Input=%1

if %Input%==help  (
goto :help
)
goto :continue



:continue
Code: [Select]echo Off

set Input=%1
echo %input%
pause
if %Input%!==! goto :start
if %Input%==Help goto :Help



Discussion

No Comment Found