Sinisterly
My First Batch Program, is it an good? - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Coding (https://sinister.ly/Forum-Coding--71)
+--- Thread: My First Batch Program, is it an good? (/Thread-My-First-Batch-Program-is-it-an-good)



My First Batch Program, is it an good? - Bladefade - 01-05-2014

Hey, I'm Bladefade or ZeroPointZach, I don't really care what you call me but this is my first batch program.
I got into batch about 3-4 days ago and I was wanting to practice but I didn't know what to make and my friend suggested I make this for him.
So what do you guys think of it?

Code:
@echo off title Pinger Program [v 1.0] color 0a REM If you do edit this program and distribute it, it would be a big help if you maybe credited me somewhere. You don't have to doe :p :LogData echo Opened at %time% on %date%. >> Log.txt :StartPage cls echo Welcome to ZeroPointZach's Open Source Pinger Program [v 1.0] echo. echo 1. Start (Type 'Start') echo 2. Help (Type 'Help') echo 3. Quit (Type 'Quit') echo 4. Credits (Type 'Credits') echo. set /p START=Enter: echo. if %START%==Start goto Start if %START%==Help goto Help if %START%==Quit exit if %START%==start goto Start if %START%==help goto Help if %START%==quit exit :Start cls echo Welcome! Let's get started. echo. echo Note: If you need to find a sites IP enter 'Tracer' if you already have the echo IP continue. echo. echo If you would like to loop ping the IP enter 'Loop', if not just enter the echo IP. echo. set /p IP=Enter: echo. if %IP%==Loop goto Loop if %IP%==loop goto Loop echo. ping %IP% echo. pause goto StartPage :Loop cls echo Welcome to the BETA loop pinger! echo. echo Note: If you need to find a sites IP enter 'Tracer' if you already have the echo IP continue. echo. echo If you would like to go back to the echo. set /p LOOP=Enter: echo. ping %IP% goto Loop :Help cls echo Welcome to the help section! echo. echo Choose something from the following list: echo 1. How do I find a site's IP address? (Type 'SiteIP') echo 2. Who do I thank for making this awesome program? (Type 'Credits') echo That's all I can think of for now, more will be added as more people use the program and have questions. echo. set /p HELPSECTION=Enter: echo. if %HELPSECTION%==SiteIP goto SiteIP if %HELPSECTION%==siteip goto SiteIP :SiteIP cls echo Hey! I see you need help finding a site's IP! echo Well, actually most experienced hackers know that you don't need the site's IP, echo you just need to do 'ping {site address}' and then the batch would find the IP on echo its own but I guess I'll still show you how. echo To find a site's IP in CMD Prompt just type in 'tracert {site address}. echo. pause goto StartPage :Credits cls echo Coded by: ZeroPointZach echo Thought of by: ZeroPointZach echo Long story short ZeroPointZach (Me) made this whole thing. pause goto StartPage



RE: My First Batch Program, is it an good? - Inori - 01-05-2014

Nice job man! Keep up the good work!


RE: My First Batch Program, is it an good? - Inori - 01-05-2014

Nice job man! Keep up the good work!


RE: My First Batch Program, is it an good? - shimmy568 - 01-05-2014

not bad mabey you could design it's own output so it will tell right off the bat if the host is online or offline


RE: My First Batch Program, is it an good? - Bladefade - 01-06-2014

Thanks guys and Shimmy I'll try to look into that.


RE: My First Batch Program, is it an good? - ArkPhaze - 01-08-2014

Look into choice instead of things like this:
Code:
if %START%==Start goto Start if %START%==Help goto Help if %START%==Quit exit if %START%==start goto Start if %START%==help goto Help if %START%==quit exit

Also note that there is an /i switch for case insensitive comparison. I'd use CALL's instead of all these goto's as well, the rest you can learn after you learn these fundamental concepts because they are a starting point.