10 Awaesome Notepad- Batch Tutorial

Posted by Unknown on 14:11 with No comments

Notepad Tricks

Do you use notepad to save your short notes only? Yeah I know it's a great tool for that. But there is much more it can do for you. Maybe you have learned about notepad tricks based on batch programming. This is the place from where every computer geek starts his journey ( and even I am one of them ).

So what make notepad this much loving? Well first of all it's not a tool for writing purpose only, it can be used to create variety of programs including cpp, HTML, batch, exe, java etc., and support wide range of programming languages. In today's tutorial I will guide you to make use of its one of the supported language - Batch. Batch programming is very popular ( mostly among Newbies ) as it is easy to code and include simple English language based commands. I prefer to use latest notepad plus plus as it is more advanced.


Before I start, first learn how to save notepad batch program.

1. Open Notepad from search menu.

2. Here you have to write few coding ( Don't worry! I had created them for you. Choose from below list )

3. Now go to "File">"Save as" or press "Ctrl+S" from keyboard.

4. Choose location where you want to save file.

5. Now under file name, write any name you want and add ".bat" after that. For Example: Notepad-Tricks.bat

Make sure that you have typed ".bat" after name as it is file type of Batch programming and without it program will not be executed.

6. Finally hit "Save" button.

Here I goes list of 10 super amazing notepad batch program based tricks that you learned before in your life and surely you gonna love them all.


1. Find String In your Computer


Imagine can you create simple search program for your computer?  May be Not. Surely I can help you. As mentioned above batch is simple commands based language, this time I am using "findstr" which is used to search for string value. Simply save below code as "Search.bat" and as you open it a black box will appear where you have to write string that you want to search and let it do its work for few seconds. After searching it will display either result is found or not. If it is founded then results will be saved in results.txt file under same folder where you save program. Try this code -

@echo off
title find string
color 0a
echo welcome to string finder
set /p in=enter the string that you want to search:
findstr /m "%in%" * > results.txt
if %errorlevel%==0 (
echo Found! logged files into results.txt
) else (
echo No matches found
)
pause>nul
echo press any key to watch result::
start results.txt
pause>nul

2. Infinite Loop with your own choice phrase


We all know what infinite loop is?  In short words, the repetition of something in continuous way is termed as infinite loop. In this program I have used label based infinite loop ( goto command ). Save below code as "loop.bat" and open it. It will ask you to write word or phrase you want display. Finally hit enter button and see the magic. Try this code -

@echo off
title Infinite Loop
ECHO Welcome to infinite loop creator with any word or phrase.
SET /P I=what do you want to be printed in loop:
:label
echo %I%
goto label

3. Colorful Matrix Falling Effect


Maybe you have seen simple matrix falling effect. This time I had advanced it with color effect. I am using light green color text on black background. Save this code as "matrix.bat" and enjoy this tricks. 

@echo off
color 0a
title Colorful Matrix Falling
:label
echo %RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%
goto label

4. Create Folder Which can't be Renamed or Deleted


Heading itself speak. Here we will create a new folder which can neither be deleted nor can be renamed. Sounds good ? Hm. This program is based on 2 important commands - cd and md, where cd is used to mount command line on particular location ( Here it refers to the location where you want to create folder ). On the other hand, md is used to create new directory. Save below code as "folder.bat" and enjoy. Most probably, you would be thinking about on how to delete that folder than? Simply replace "md" with "rd" command from below code and repeat same steps. That's it.

@echo off
title advance folder creator
cls
color 0a
echo Welcome to Folder Creator Program
set /p in=echo write path location where you want to create folder (Example: c:\) :
cd %in%
echo Press any key to Continue
pause>nul
echo Your folder is being processed !
echo wait..!
md con\
echo folder has been successfully created at %in% location
echo Do to want to check it. Press any button to open!
pause>nul
start %in%
pause>nul

5. Shutdown Computer Using Notepad


Usually people shut down their computer using start menu button. This task can be more easy using notepad from where you can schedule it and can display Message dialog box showing reason for shutdown. This program can be used to show of your friends. Really cool trick. Try below code -

@echo off
title Shutdown
echo Welcome to shutdown program 
set /p time=Please set time for shutdown (in seconds) :
set /p msg=Write the message to be displayed :
echo press any key to continue.
pause>nul
shutdown /s /t %time% /c "%msg%"
echo Time has been scheduled. Enjoy.
pause>nul

6. Hang Your Computer


Sometimes your computer may hang after a long use. This is because of increase in number of program & cached data which result into heavy load on RAM. Using this concept I had create a very simple program that has power to hang your computer. I am using start command ( to open programs ) under infinite loop so that it can continuously do that. Try below code and save as "hang.bat". As you open, it will ask for permission to continue. After which it will continuously open notepad, command prompt, C Drive, D Drive, E Drive, G Drive and finally you have to shutdown your computer with power button to stop that. First time I used this trick to prank my friends and he really got shocked after seeing this.

@echo off
title Hang Computer
color 0a
echo Are you sure you want to hang you computer?
echo press any key to continue.
pause>nul
:label
start notepad
start c:\
start d:\
start cmd.exe
start e:\
start g:\
goto label

7. Get Your Laptop Battery Energy Efficiency Report


Have laptop and facing battery problem? Now you don't need to go to service centre. Use this trick and get complete energy efficiency report. Save below batch file as "report.bat". You need administration permission to access this program. Simply right-click on file and select "Run as Administrator". Click OK button to allow permission. Wait for few 60 seconds and let it do its work. After analysing, final report will be saved in C drive as energy-report.html file. Apart from error and warnings, it will display complete information about your battery like Battery ID, Manufacturer, serial number, Chemistry etc.,

@echo off
title Get Energy Efficiency
color 0a
cd c:
echo collecting battery information
powercfg -energy
echo battery information has been saved in your c drive
echo press enter to see result in html format
pause>nul
start c:\energy-report.html
pause>nul

8. Delete Files Using Notepad


Deleting files is the simplest thing everyone can do and we usually opt normal way to do that. But do you know you can also use notepad for that. Copy paste below code inside notepad editor and save as "delete.bat".

@echo off
color 0a
title Delete Files
set /p I=write the path location of file you want to delete:
del %I%
echo your file from %I% has been successfully deleted.
pause>nul

9. Create Unlimited Folders - Crash RAM


This trick also work in same way as #6th works and can hang your computer. As I already told, md commands is used to create new directory. Here I am advancing it to create Unlimited Folders using random operator. You just need to save below code as "folder.bat" and see its magic. I recommend you to save this program in new folder ( Desktop location is best ) as it will flooded thousands of folder which will be hard to delete one by one.

@echo off
title Folder Creator
color 0a
echo welcome to infinite folder creator
echo Are you sure to continue ?
pause>nul
:make 
md %random% 
goto make
pause>nul

10. Hide Files/Folders Using Notepad


By default, windows provide manual way to hide files or folder. However anyone can un-hide them. So this is simply useless. This time I have created batch program using "attrib" commands which is smart enough to hide files and interesting thing is no one can un-hide them except you. Save below code as "hide.bat". As you open, it will ask to write file or folder location you want to hide. For an instance if you want to hide folder named as "important files" saved on desktop then right-click it and choose properties. A new box will appear, copy location address and write inside program. Example : c:\users\YourComputerName\Desktop\important files

Now if you want to unhide them, simply replace "attrib +s +h" with "attrib -s -h" from below code and repeat same steps as above.


@echo off
title Hide File/folder
color 0a
echo Welcome to hide file/folder program
set /p I=write file/folder path location you want to hide:
echo press any key to continue.
pause>nul
attrib +s +h %I%
echo Your files has been successfully hidden
pause>nul

Final Words


So these are best top 10 cool notepad tricks you should try right now. I bet that these are new for you. what did you think about this? Last but not least if you have any problem or want to suggest something, please ask me in below comment. Let's take this stage to next level. Start Conversation now.
Categories: