# What's wrong with this batch code.



## SuddenG (May 6, 2009)

Hi, I've been developing this program and I always get this problem:

When I type option c it works fine, also option m works fine. But when I type option f it takes me to option c. I've re-written it and it still happens.

Please your suggestions and help will be appreciated:


```
@echo off
title C:SS help program.
:menu
color e
echo   **************************************************************
echo   C:SS Help Program - Built by SuddenGunfire
echo   **************************************************************
echo.
echo Please choose an option below to start!
echo.
echo ********************************************************
echo C = Find your Counter-Strike:Source Folder.
echo M = Install C:SS maps.
echo F = Goto counterstrikesource.com C:SS help section.
echo P = Find your system Specs.
echo G = Install Skins.
echo O = Copyright information.
echo E = Exit the program.
echo *******************************************************
echo.
set /p c=Option:
if %c%==c goto c
if %c%==C goto c
if %c%==m goto m
if%c%==M goto m
if%c%==f goto f
if%c%==F goto s
if%c%==p goto p
if%c%==P goto p
if%c%==g goto g
if%c%==G goto g
if%c%==o goto o
if%c%==O goto o
if%c%==e goto e
if%c%==E goto e
:c
cls
echo.
echo ----------------------------------------------------------------------------------------------------------
echo This will open the SteamApps folder.
echo Once there you need to click on the folder with your Steam account name on.
echo.
echo Press any key to open your C:SS folder.
echo ----------------------------------------------------------------------------------------------------------
pause>nul
%SystemRoot%\explorer.exe "C:\Program Files\Steam\Steamapps"
pause>nul
cls
goto :menu
:m
cls
echo.
echo -----------------------------------------------------------------------------------------------------------------------------------------------
echo This section will take you to a popular skin website and will also open your materials and models folder.
echo -----------------------------------------------------------------------------------------------------------------------------------------------
echo.
echo Please press any key to start installing maps...
pause>nul
start explorer http://www.fpsbanana.com/skins/games/2
%SystemRoot%\explorer.exe "C:\Program Files\Steam\Steamapps\"
cls
echo When steamapps is loaded up navigate to:
echo yourname-cstrike-
echo Then drag and drop your skin files into there.
echo.
echo If prompted to overwrite files, click "Yes To All" 
pause>nul
cls
goto :menu
:f
cls
echo.
echo -----------------------------------------------------------------------------------------------------------------------------
echo This section will take you to the counterstrikesource.com C:SS support section.
echo -----------------------------------------------------------------------------------------------------------------------------
start explorer http://www.counterstrikesource.com/forums/viewforum.php?f=38
cls
echo Thank you for visiting, you should register it's great.
echo.
echo I'm a member there, look up "SuddenGunfire"
pause>nul
cls
goto :menu
```


----------



## Kreij (May 6, 2009)

Well, if you are typing an uppercase "F" it's telling you to go to "s".


----------



## SuddenG (May 6, 2009)

I changed that but it still didn't help.


----------



## FordGT90Concept (May 6, 2009)

SuddenG said:


> Hi, I've been developing this program and I always get this problem:
> 
> When I type option c it works fine, also option m works fine. But when I type option f it takes me to option c. I've re-written it and it still happens.
> 
> ...


Put a space in "Go to" or replace goto with "Open" or something similar.  That might fix it.


May I also suggest that you use more descriptive labels?  For instance, instead of "c" use "folder."  You could easily be getting overlap of names causing erratic behavior.


----------



## SuddenG (May 6, 2009)

This isn't helping.!


----------



## FordGT90Concept (May 6, 2009)

Well, if that is the whole batch then you're missing several of them.

p, g, o, and e labels are missing.  If you push a key that references a non-existant label, the goto just falls through.

I renamed the labels that are present below.

```
@echo off
title C:SS help program.
:menu
color e
echo   **************************************************************
echo   C:SS Help Program - Built by SuddenGunfire
echo   **************************************************************
echo.
echo Please choose an option below to start!
echo.
echo ********************************************************
echo C = Find your Counter-Strike:Source Folder.
echo M = Install C:SS maps.
echo F = Open counterstrikesource.com C:SS help section.
echo P = Find your system Specs.
echo G = Install Skins.
echo O = Copyright information.
echo E = Exit the program.
echo *******************************************************
echo.
set /p opt=Option:
if %opt%==c goto folder
if %opt%==C goto folder
if %opt%==m goto maps
if %opt%==M goto maps
if %opt%==f goto help
if %opt%==F goto help
if %opt%==p goto p
if %opt%==P goto p
if %opt%==g goto g
if %opt%==G goto g
if %opt%==o goto o
if %opt%==O goto o
if %opt%==e goto e
if %opt%==E goto e

:folder
cls
echo.
echo ----------------------------------------------------------------------------------------------------------
echo This will open the SteamApps folder.
echo Once there you need to click on the folder with your Steam account name on.
echo.
echo Press any key to open your C:SS folder.
echo ----------------------------------------------------------------------------------------------------------
pause>nul
%SystemRoot%\explorer.exe "C:\Program Files\Steam\Steamapps"
pause>nul
cls
goto :menu

:maps
cls
echo.
echo -----------------------------------------------------------------------------------------------------------------------------------------------
echo This section will take you to a popular skin website and will also open your materials and models folder.
echo -----------------------------------------------------------------------------------------------------------------------------------------------
echo.
echo Please press any key to start installing maps...
pause>nul
start explorer http://www.fpsbanana.com/skins/games/2
%SystemRoot%\explorer.exe "C:\Program Files\Steam\Steamapps\"
cls
echo When steamapps is loaded up navigate to:
echo yourname-cstrike-
echo Then drag and drop your skin files into there.
echo.
echo If prompted to overwrite files, click "Yes To All" 
pause>nul
cls
goto :menu

:help
cls
echo.
echo -----------------------------------------------------------------------------------------------------------------------------
echo This section will take you to the counterstrikesource.com C:SS support section.
echo -----------------------------------------------------------------------------------------------------------------------------
start explorer http://www.counterstrikesource.com/forums/viewforum.php?f=38
cls
echo Thank you for visiting, you should register it's great.
echo.
echo I'm a member there, look up "SuddenGunfire"
pause>nul
cls
goto :menu
```


----------



## SuddenG (May 6, 2009)

worked like a charm. Thanks guys!


----------



## Duxx (May 6, 2009)

Click the little thanks button for him helping you out. 8)


----------

