• 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)
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
 

Kreij

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.21/day)
Location
Cheeseland (Wisconsin, USA)
Well, if you are typing an uppercase "F" it's telling you to go to "s".
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.65/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
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
26,259 (4.65/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
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
 
D

Duxx

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