Post: Some .Bat file help?
02-19-2012, 01:43 AM #1
~SpongeBob
[move]Winning.[/move]
(adsbygoogle = window.adsbygoogle || []).push({}); ok so me and my friend are making a .bat file to open websites and what-not and were trying to add some authorization to it, i got somthing that works, but i want it to actualy work, not just close becuase of an error, so any help/sugestions are greatly welcomed!
    @echo off
Title Authorization
color 7
echo what is your name?
set /p input=
if %input%==max goto password
if %input%==jayden goto password
if %input% NOT ==max goto password2
:password
cls
echo what is your password?
set /p input=
if %input%==963pop goto Hello
if %input%==%not963pop% goto goodbye
cls
:password2
echo Please Re-Enter Your name.
set p/ input=
if %input%==jayden goto password
if %input%==%notjayden% goto goodbye
cls
:goodbye
cls
echo I'm sorry, But You have the incorrect password.
Pause
Exit
cls
:hello
cls
Title Access Granted!
echo Access Granted!
pause
cls
goto website
:website
Title Welcome!
cls
color 4
echo What Catagory Do you Wish to access?
echo (1) Websites
echo (2) Usernames and passwords
echo (3) Computer Commands
echo (4) Done
set /p input=
if %input%==1 goto web
if %input%==2 goto user
if %input%==3 goto CompCmd
if %input%==4 goto kill
if %input%==done goto kill
cls
pause
cls
:web
Color 4
title Websites:
cls
Echo what Website do you wish to go to?
echo (1) Runescape
Echo (2) Facebook
Echo (3) Google
Echo (4) Minecraft
Echo (5) Youtube
Echo (6) Back to Main Screen
set /p input=
if %input%==1 goto rune
if %input%==2 goto face
if %input%==3 goto google
if %input%==4 goto minecraft
if %input%==5 goto youtube
if %input%==6 goto website
if %input%==done goto stop
cls
:rune
Start Https://world1.runescape.com
cls
Pause
goto website
:face
Start Https://www.facebook.com
cls
pause
goto website
:google
start Https://www.google.com
puase
goto website
:minecraft
start https://www.minecraft.net
pause
goto website
:youtube
start Https://www.youtube.com
pause
goto website
:user
Title Usernames/Passwords
color 4
cls
Echo What kind of username/passwords are you looking for?
Echo (1) Runescape
Echo (2) Facebook
Echo (3) School
Echo (4) Youtube
Echo (5) Email
Echo (6) Back to Main Screen
set /p input=
if %input%==1 goto runeuser
if %input%==2 goto faceuser
if %input%==3 goto schooluser
if %input%==4 goto youtubeuser
if %input%==5 goto emailuser
if %input%==6 goto website
if %input%==done goto stop
cls
:runeuser
cls
Title Runescape Accounts
color 9
echo Username:
Echo password:
Echo --------------------------------------
echo username:
Echo password:
Echo --------------------------------------
echo username:
Echo password:
Echo --------------------------------------
pause
cls
goto user
:faceuser
cls
color 9
Title Facebook Accounts
Echo Username:LoL
Echo Password:Wut?
Pause
cls
goto user
:schooluser
cls
color 9
Title School Accounts
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Pause
cls
goto user
:youtubeuser
cls
color 9
Title Youtube Accounts
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
echo Password:
Echo -------------------------
Pause
cls
goto user
:emailuser
cls
Title Email Accounts
color 9
Echo Username:
Echo password:
Echo --------------------------------------
Echo Username:
Echo Password:
Echo --------------------------------------
Echo Username:
Echo password:
Echo --------------------------------------
Echo Username:
Echo Password:
Echo --------------------------------------
Pause
cls
goto user
:compcmd
cls
Title Computer Commands
Color 9
Echo What Computer Command Do you want to use?
Echo (1) Command Prompt
Echo (2) Shutdown Others Computer (Reqs. Admin Access)
Echo (3) Shutdown This Computer
Echo (4) Log Off This Computer
Echo (5) Switch Users
Echo (6) Control Pannel
Echo (7) Go Back to Main Screen
set /p input=
if %input%==1 goto cmd
if %input%==2 goto shutdownO
if %input%==3 goto shutdownMe
if %input%==4 goto Logoff
if %input%==5 goto SwitchUser
if %input%==6 goto CntrlP
if %input%==7 goto website
if %input%==done goto stop
:cmd
Start Cmd
Pause
goto compcmd
:shutdown0
cls
Shutdown -i
Echo You have to have admin Access to use this
Echo And remember to Watch for teachers
Pause
goto compcmd
:shutdownMe
Echo Are you Sure you wish to shutdown?
pause
shutdown -s -t 30 -c “Shutdown in 30 seconds”
pause
goto kill
:Logoff
Echo Are you Sure you wish to Log Off This computer?
Pause
logoff
Pause
goto kill
:SwitchUser
Echo Are you sure you want to switch user?
Pause
Lock
goto website
:CntrlP
control
Pause
goto compcmd
:kill
cls
echo Thanks For Using Me!
pause
EXIT

the password part is in the first few sections, thanks!
(adsbygoogle = window.adsbygoogle || []).push({});
02-19-2012, 06:10 PM #2
ozzy21
Little One
Originally posted by SpongeBob View Post
ok so me and my friend are making a .bat file to open websites and what-not and were trying to add some authorization to it, i got somthing that works, but i want it to actualy work, not just close becuase of an error, so any help/sugestions are greatly welcomed!
    Your Code here

the password part is in the first few sections, thanks!


Alright, I've found multiple mistakes in the code. I'll bullet them out for you

  • Your "not" statements should be right after the "if" statements, before the value "input" in the first function.
  • You used the same value for each question, you have to use something other than "input" for a different question.
  • After the name was entered incorrectly twice, you made it go to :goodbye, which says "I'm sorry, But you have the incorrect Password" Nothing big, but I thought I would point it out.
  • Finally, you added the "cls" command after "goto" in each function. That'll do nothing as it leaves the function before it even reads to clear it. You have to add that in the beginning of a new function or before the "goto" command. Again, not a big deal Smile


Here's the code I came up with for you fixing these problems:

    @echo off
Title Authorization
color 7
echo what is your name?
set /p input=
if %input%==max goto password
if %input%==jayden goto password
if NOT %input%==max goto password2
:password
cls
echo what is your password?
set /p pass=
if %pass%==963pop goto Hello
if not %pass%==963pop goto goodbye
:password2
cls
echo Please Re-Enter Your name.
set /p pass2=
if %pass2%==max goto password
if %pass2%==jayden goto password
if not %pass2%==jayden goto incName
:incName
cls
echo I'm sorry, but that name is not authenticated for this program.
pause
exit
:goodbye
cls
echo I'm sorry, but You have the incorrect password.
Pause
Exit
:hello
cls
Title Access Granted!
echo Access Granted!
pause
cls
goto website
:website
Title Welcome!
cls
color 4
echo What Catagory Do you Wish to access?
echo (1) Websites
echo (2) Usernames and passwords
echo (3) Computer Commands
echo (4) Done
set /p catgry=
if %catgry%==1 goto web
if %catgry%==2 goto user
if %catgry%==3 goto CompCmd
if %catgry%==4 goto kill
if %catgry%==done goto kill
cls
pause
cls
:web
Color 4
title Websites:
cls
Echo what Website do you wish to go to?
echo (1) Runescape
Echo (2) Facebook
Echo (3) Google
Echo (4) Minecraft
Echo (5) Youtube
Echo (6) Back to Main Screen
set /p website=
if %website%==1 goto rune
if %website%==2 goto face
if %website%==3 goto google
if %website%==4 goto minecraft
if %website%==5 goto youtube
if %website%==6 goto website
if %website%==done goto stop
cls
:rune
Start Https://world1.runescape.com
cls
Pause
goto website
:face
Start Https://www.facebook.com
cls
pause
goto website
:google
start Https://www.google.com
puase
goto website
:minecraft
start https://www.minecraft.net
pause
goto website
:youtube
start Https://www.youtube.com
pause
goto website
:user
Title Usernames/Passwords
color 4
cls
Echo What kind of username/passwords are you looking for?
Echo (1) Runescape
Echo (2) Facebook
Echo (3) School
Echo (4) Youtube
Echo (5) Email
Echo (6) Back to Main Screen
set /p users=
if %users%==1 goto runeuser
if %users%==2 goto faceuser
if %users%==3 goto schooluser
if %users%==4 goto youtubeuser
if %users%==5 goto emailuser
if %users%==6 goto website
if %users%==done goto stop
cls
:runeuser
cls
Title Runescape Accounts
color 9
echo Username:
Echo password:
Echo --------------------------------------
echo username:
Echo password:
Echo --------------------------------------
echo username:
Echo password:
Echo --------------------------------------
pause
cls
goto user
:faceuser
cls
color 9
Title Facebook Accounts
Echo Username:LoL
Echo Password:Wut?
Pause
cls
goto user
:schooluser
cls
color 9
Title School Accounts
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Pause
cls
goto user
:youtubeuser
cls
color 9
Title Youtube Accounts
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
Echo Password:
Echo -------------------------
Echo Username:
echo Password:
Echo -------------------------
Pause
cls
goto user
:emailuser
cls
Title Email Accounts
color 9
Echo Username:
Echo password:
Echo --------------------------------------
Echo Username:
Echo Password:
Echo --------------------------------------
Echo Username:
Echo password:
Echo --------------------------------------
Echo Username:
Echo Password:
Echo --------------------------------------
Pause
cls
goto user
:compcmd
cls
Title Computer Commands
Color 9
Echo What Computer Command Do you want to use?
Echo (1) Command Prompt
Echo (2) Shutdown Others Computer (Reqs. Admin Access)
Echo (3) Shutdown This Computer
Echo (4) Log Off This Computer
Echo (5) Switch Users
Echo (6) Control Pannel
Echo (7) Go Back to Main Screen
set /p command=
if %command%==1 goto cmd
if %command%==2 goto shutdownO
if %command%==3 goto shutdownMe
if %command%==4 goto Logoff
if %command%==5 goto SwitchUser
if %command%==6 goto CntrlP
if %command%==7 goto website
if %command%==done goto stop
:cmd
Start Cmd
Pause
goto compcmd
:shutdown0
cls
Shutdown -i
Echo You have to have admin Access to use this
Echo And remember to Watch for teachers
Pause
goto compcmd
:shutdownMe
Echo Are you Sure you wish to shutdown?
pause
shutdown -s -t 30 -c “Shutdown in 30 seconds”
pause
goto kill
:Logoff
Echo Are you Sure you wish to Log Off This computer?
Pause
logoff
Pause
goto kill
:SwitchUser
Echo Are you sure you want to switch user?
Pause
Lock
goto website
:CntrlP
control
Pause
goto compcmd
:kill
cls
echo Thanks For Using Me!
pause
EXIT


*Also, if you type the incorrect number or something other than # 1-6 where it asks about what website, username, commands, ect. then it just goes to the next function, I don't know if you care or not, but I haven't fixed it in that code.

The following user thanked ozzy21 for this useful post:

~SpongeBob
02-20-2012, 12:49 AM #3
~SpongeBob
[move]Winning.[/move]
Thanks for the help dude!
anything else i need to add to it?
02-22-2012, 04:09 AM #4
ozzy21
Little One
Originally posted by SpongeBob View Post
Thanks for the help dude!
anything else i need to add to it?


Nope, not that I can see :P
02-24-2012, 02:29 AM #5
~SpongeBob
[move]Winning.[/move]
Originally posted by ozzy21 View Post
Nope, not that I can see :P

I do thank you for your time, but, might you know of anything I might want to add, i enjoy impressing my friends with it, and i have school admin access (They have horrid passwords) and do shutdown -i, is there anything else that i can add to mess with other peoples computers?
02-24-2012, 10:38 PM #6
Cory
User needs a dick
Originally posted by OGW View Post
What you need help with bro


If you would actually read the thread before you post I think you could answer this yourself. And judging by your previous posts, I would say you had no business offering help in the first place, as you would not be able to provide an answer.

The following user thanked Cory for this useful post:

Pichu
02-25-2012, 04:25 AM #7
Pichu
RIP PICHU.
Originally posted by Poynt View Post
If you would actually read the thread before you post I think you could answer this yourself. And judging by your previous posts, I would say you had no business offering help in the first place, as you would not be able to provide an answer.


It's called, "Post-Boosting". They come in here and just see that someone needs help and just types that and doesn't even read the first post to realize the question has already been put out there for suggestions/fixes.
03-13-2012, 01:59 AM #8
DiJiTaLGoDz
Former Staff
Question answered.

CLOSED

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo