• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

What's wrong with this batch code.

SuddenG

New Member
Joined
May 6, 2009
Messages
7 (0.00/day)
Likes
0
#1
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:

Code:
@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
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
21,056 (6.22/day)
Likes
10,181
Location
IA, USA
System Name BY-2015
Processor Intel Core i7-6700K (4 x 4.00 GHz) w/ HT and Turbo on
Motherboard MSI Z170A GAMING M7
Cooling Scythe Kotetsu
Memory 2 x Kingston HyperX DDR4-2133 8 GiB
Video Card(s) PowerColor PCS+ 390 8 GiB DVI + HDMI
Storage Crucial MX300 275 GB, Seagate 6 TB 7200 RPM
Display(s) Samsung SyncMaster T240 24" LCD (1920x1200 HDMI) + Samsung SyncMaster 906BW 19" LCD (1440x900 DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay
Audio Device(s) Realtek Onboard, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse SteelSeries Sensei RAW
Keyboard Tesoro Excalibur
Software Windows 10 Pro 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
#4
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:

Code:
echo F = [b][u]Goto c[/u][/b]ounterstrikesource.com C:SS help section.
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.
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
21,056 (6.22/day)
Likes
10,181
Location
IA, USA
System Name BY-2015
Processor Intel Core i7-6700K (4 x 4.00 GHz) w/ HT and Turbo on
Motherboard MSI Z170A GAMING M7
Cooling Scythe Kotetsu
Memory 2 x Kingston HyperX DDR4-2133 8 GiB
Video Card(s) PowerColor PCS+ 390 8 GiB DVI + HDMI
Storage Crucial MX300 275 GB, Seagate 6 TB 7200 RPM
Display(s) Samsung SyncMaster T240 24" LCD (1920x1200 HDMI) + Samsung SyncMaster 906BW 19" LCD (1440x900 DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay
Audio Device(s) Realtek Onboard, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse SteelSeries Sensei RAW
Keyboard Tesoro Excalibur
Software Windows 10 Pro 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
#6
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.
Code:
@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