6 Cool Programming Tricks Inside Microsoft Notepad
No coding skills? No problem. Microsoft Notepad has you covered.
Anyone can use Notepad to play around with code and make programs to personalize the Windows experience (in a very informal and fixable way). Even if you know nothing about coding, there are lots of basic code examples out there that you can cut and paste into Notepad for some PC Magic.
Here are six cool programs that anybody can use to create simple little programs on their PC. All these scripts were tested using Windows 10 Creators Update and may perform slightly different on your Windows setup.
1 - Make a Personal Diary
This one is simple, but might be considered useful to some.
1) Type “.LOG” into a new Notepad document (without quotation marks). Note: It must be all UPPERCASE.
2) Save as a regular text document.
3) Close it.
4) Double-click on the doc. Every time you open the document it will show the time and date. You can just write any text below it. This is good for keeping a diary or for logging observations of something as it changes over time.
2 - Make Your Computer Talk
Now you can be just like Matthew Broderick at the height of 1983 tech
and make your PC talk with a human-ish voice. It’s fun! Here’s what you do.
1) Type the following code into a Notepad doc:
Dim Message, Speak
Message=InputBox(“Enter text”,”Speak”)
Set Speak=CreateObject(“sapi.spvoice”)
Speak.Speak Message
2) Save as “talk.vbs” or whatever (the important thing is that you save it as a .vbs file).
3) Double-click on the icon to prompt a pop-up window. Enter some text in the box and behold your ear holes!
3 - Turn Your Keyboard Into an EDM Festival
1) Paste the following code into a Notepad doc:
Set wshShell =wscript.CreateObject(“WScript.Shell”)
do
wscript.sleep 100
wshshell.sendkeys “{CAPSLOCK}”
wshshell.sendkeys “{NUMLOCK}”
wshshell.sendkeys “{SCROLLLOCK}”
loop
2) Save as a .vbs file.
3) Double-click on saved file.
4) Dance.
5) What is happening is the computer is rapidly toggling the CAPS lock, NUMBER lock, and SCROLL lock on and off (which usually lights an LED on most keyboards). This is very annoying if you want to actually use your keyboard for typing. If you want to turn it off, you have to 1) restart the computer or 2) in Windows 10, go to Task Manager and end “Microsoft Windows Based Script Host.” (I haven’t confirmed it, but reportedly if you’re using Windows 8 or before, you’ll want to end “wscript.exe” in Task Manager.)
4 - Guessing Game
Here’s a good way to pass the time if you’re bored via Instructables
.
1) Paste the following into a Notepad doc:
@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.
: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%==%variable1% ECHO Found the backdoor hey?, the answer is: %answer%
goto top
:equal
echo Congratulations, You guessed right!!!
echo.
echo It took you %guessnum% guesses.
echo.
pause
2) Save as a .bat file.
3) Double-click the file. Guess away!
5 - Password Generator
Your passwords probably suck. If you want to create a simple (numeric) random password generator, you can do that with this little trick (via Instructables
). Sometimes the numbers are four-digits long; some are five-digits long. Basically, this is more of a PIN generator.
1) Paste the following code in a Notepad doc.
@echo off
:Start2
cls
goto Start
:Start
title Password Generator
echo I will make you a new password.
echo Please write the password down somewhere in case you forget it.
echo — — — — — — — — — — — — — — — — — — — — ¬ — — — — — — — — — — — -
echo 1) 1 Random Password
echo 2) 5 Random Passwords
echo 3) 10 Random Passwords
echo Input your choice
set input=
set /p input= Choice:
if %input%==1 goto A if NOT goto Start2
if %input%==2 goto B if NOT goto Start2
if %input%==3 goto C if NOT goto Start2
:A
cls
echo Your password is %random%
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:Exit
exit
:B
cls
echo Your 5 passwords are %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:C
cls
echo Your 10 Passwords are %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
2) Save as a .bat file.
3) Double-click on the file.
6 - A Virtual Calculator
This hand-coded calculator is more a cool proof-of-concept than something I would honestly recommend for your number-crunching needs. Your PC or phone most likely comes with a more intuitive virtual calculator, as does the browser you’re probably reading this on. (Via Instructables
)
1) Paste the following into a Notepad doc:
@echo off
title Batch Calculator by seJma
color 1f
:top
echo — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
echo Welcome to Batch Calculator
echo — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
echo.
set /p sum=
set /a ans=%sum%
echo.
echo = %ans%
echo — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
pause
cls
echo Previous Answer: %ans%
goto top
pause
exit
2) Save as a .bat file.
3) Math away. Note: it can only handle integers. And only those of a certain number of digits. It also doesn’t handle complex equations all that well. But other than all that, it’s just fine.
follow for more coding tips and comment if you want to video tutorial
stay in peace,
Raymond,