Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,147,906 members, 7,799,051 topics. Date: Tuesday, 16 April 2024 at 02:30 PM

Shutting Down A Computer Using Notepad (beginners Tutorial) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Shutting Down A Computer Using Notepad (beginners Tutorial) (6047 Views)

Where Can I Download A Functioning Notepad++ For Mobile Version From? / Trick: How To Make A Simple Calculator Using Notepad. / 10 Coolest Notepad Tricks (2) (3) (4)

(1) (2) (Reply) (Go Down)

Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 1:03pm On Jan 18, 2016
Notepad is a free text editor that comes with Computers running the Windows OS, It is also a competent code editor...many don't know this, Some people use it for quick typing!
We will be creating a command that will shut the computer down when run, also we will set a timer that shuts down the computer at "X" seconds!

Enough of my talking and let's get started..



First Step:

Open Notepad (You can find Notepad by clicking the Start menu and selecting "Programs" → "Accessories" → "Notepad". You can also click the Start menu, type notepad, and press ↵ Enter.)
See Illustration below


Second Step:

Type
shutdown.exe -s
on the first line. This is the command to shut down the computer.
See Illustration below


Third Step:

Add a timer by using the
-t
flag. By default, the shutdown process will be delayed by 30 seconds. You can change this by using the
-t
gflag with the number of seconds you want to delay.

For example, to create a shutdown command that waits 45 seconds, type
shutdown.exe -s -t 45

To create a shutdown command that shuts the computer down immediately, type
shutdown.exe -s -t 00

See Illustration below


Fourth Step:

Add a message to be displayed. If you want, you can add a personalized message to the shut down notice by using the
-c
flag. Simply, type
shutdown.exe -s -t 45 -c "comment"
. The comment must be in quotes.[1]

For example, you can let the user know how long until the shutdown begins by typing
shutdown.exe -s -t 45 -c "Computer will shut down in 45 seconds"
or
shutdown.exe -s -t 45 -c "Hey, My name is Daniel and i'm shutting this computer down NOW"

LOL, don't do that.. that's mean, but for a prank...Who cares?
See Illustration below


Fifth Step:

Click "File" and select "Save As". You will need to save the file as a batch file, which Windows can execute to run the shutdown command.


Sixth Step:

Click the "Save as type" drop-down menu and select "All Files (*.*)". This will allow you to change the file type.


Seventh Step:

Delete the
.txt
from the end of the file name. Replace it with
.bat



Eight Step:

Save the file. A new copy will be created with the
.bat
extension, and it will have a different icon than a standard text file.
See Illustration below


Final Step:

Run the newly-created file to run your shutdown process. The shutdown will occur according to the rules you created.
Make sure you've saved anything you need to before running the shut down program.

**More tutorials will be available, you can send me a topic request through Nairaland.
**This tutorial is solely for educational purposes so i am not in any way responsible for whatever illegal content made out of this tutorial.

Best Regards,
Daniel Omoniyi

2 Shares

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by yinkeys(m): 2:44pm On Jan 18, 2016
All these geeks ehn!! shocked

1 Like

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 2:44pm On Jan 18, 2016
Next tutorial will be on building an API driven website.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by yinkeys(m): 3:36pm On Jan 18, 2016
All these free programmers should just come host free landing pages/sites for me grin cheesy

1 Like

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by adehsenior(m): 9:43pm On Jan 18, 2016
mehn this shit worked like hell, mehnnn if never been amused learning a new thing like this before.
pls add me to the new whatsapp group
08130690141.
Thanks in anticipation

2 Likes

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 11:18am On Jan 19, 2016
If you want a slider on your website checkout my new tutorial at
https://www.nairaland.com/2875699/coding-responsive-slider-html-css
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 3:18pm On Jan 20, 2016
Op please i have been looking for materials that will educate me on batch file programming, do you have anything for beginners.

1 Like

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by timtoday: 12:17am On Jan 21, 2016
Nice work on the tutorial. But all these could be done on a single line either on window OS or Linux OS.

On Command Line Interface (CLI) on windows like thus:

C:\> shutdown /s /t 45 /c "Shutting Down in 45secs"

There is a whole lots of stuff can do with this just check using the help option on the shutdown command like so:

C:\> shutdown \h

You will see how to use the command and a whole lots of options that you can combine with it.

On Linux OS:

prompt> sudo /sbin/shutdown -h now
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 1:37am On Jan 21, 2016
Oops I want in 08138774173Oops I want in 08138774173Oops I want in 08138774173
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by tuncetila(m): 2:06pm On Jan 21, 2016
please add me 08027666029
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by lovelyadeola(m): 2:24pm On Jan 21, 2016
Add me please 08180970599
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 4:02pm On Jan 21, 2016
@Timtoday Your procedure is 100% correct, not that i don't know the shortcut...
But i wanted it to be easy to understand for the beginners, that was why i had that in bracket!

Anyways, Good Job!
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 4:03pm On Jan 21, 2016
And again i was banned by the Nairaland Spam Bots...
Those bots need to be worked on...they kept me off Nairaland for a whole day!
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 5:12pm On Jan 21, 2016
08100934487 add me
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 5:51pm On Jan 21, 2016
DanielTheGeek:
And again i was banned by the Nairaland Spam Bots...
Those bots need to be worked on...they kept me off Nairaland for a whole day!
I am not surprised the bots are banning you, you probably deserved it. Those bots are working well as they should, at least i have not been banned this year (yet).
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by sketchman: 5:08am On Jan 22, 2016
08037364783. that is my number, add me to your whatsapp group.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by lilvinco: 7:09am On Jan 22, 2016
08143280602
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 9:24am On Jan 22, 2016
timtoday:
Nice work on the tutorial. But all these could be done on a single line either on window OS or Linux OS.

On Command Line Interface (CLI) on windows like thus:

C:\> shutdown /s /t 45 /c "Shutting Down in 45secs"

There is a whole lots of stuff can do with this just check using the help option on the shutdown command like so:

C:\> shutdown \h

You will see how to use the command and a whole lots of options that you can combine with it.

On Linux OS:

prompt> sudo /sbin/shutdown -h now

I can even close my eyes and do that on windows. Just press LOGO-KEY + R, type command and press enter, no need of prompt sef.
Why would i want to write that in a batch file? I get better things to do with a batch file o jare - dont let us even go there. I be master for batch-file writing, but it is a basic skill that every win32 programmer should have.

Writing batch file for a windows programmer, is like writing bash files for linux - but i be cross-platform programmer sha.

This OP is just a bloody attention seeker, ain't even got better post to make sef. Deserves a permanent ban for constituting nuisance to the board.

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 10:46am On Jan 22, 2016
dhtml18:

I can even close my eyes and do that on windows. Just press LOGO-KEY + R, type command and press enter, no need of prompt sef.
Why would i want to write that in a batch file? I get better things to do with a batch file o jare - dont let us even go there. I be master for batch-file writing, but it is a basic skill that every win32 programmer should have.

Writing batch file for a windows programmer, is like writing bash files for linux - but i be cross-platform programmer sha.

This OP is just a bloody attention seeker, ain't even got better post to make sef. Deserves a permanent ban for constituting nuisance to the board.
The Op said beginner's tutorial and as you can see a lot of us have benefitted from it , why dont you gather your itk and shove it through your fanny , God knows I hate people like you
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 1:43pm On Jan 22, 2016
malailayi:
The Op said beginner's tutorial and as you can see a lot of us have benefitted from it , why dont you gather your itk and shove it through your fanny , God knows I hate people like you
Yeeepaaa! and i put it to you directly that the OP is a teacher teaching nonsense! Inside the screenshot i posted and the jagba-jan-tis the OP posted, which one is more useful?
By the way, who told you that I am not a beginner? So dont ask me to shove it, it is the OP that should shove his jagba-jan-tis teaching up his &$%*@ or down his throat. Just a bloody attention seeker!
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by sinequanon: 2:29pm On Jan 22, 2016
dhtml18:

I can even close my eyes and do that on windows. Just press LOGO-KEY + R, type command and press enter, no need of prompt sef.
Why would i want to write that in a batch file? I get better things to do with a batch file o jare - dont let us even go there. I be master for batch-file writing, but it is a basic skill that every win32 programmer should have.

Hi, how is the farmwork?

On the top right hand side of my laptop there is even a button that shuts down the machine. But I will go into that in the next tutorial. grin

smiley

The general idea is OK. It does capture people's imagination, but the thread shouldn't be titled as it is. It is not notepad shutting down the computer. Very misleading for a complete beginner.

And beginners be careful. Don't follow blindly. Understand all instructions that you are running in a batch file. Some of them can cause damage or loss of files.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 2:32pm On Jan 22, 2016
sinequanon:


On the top right hand side of my laptop there is even a button that shuts down the machine. But I will go into that in the next tutorial. grin

smiley

The general idea is OK. It does capture people's imagination, but the thread shouldn't be titled as it is. It is not notepad shutting down the computer. Very misleading for a complete beginner.

And beginners be careful. Don't follow blindly. Understand all instructions that you are running in a batch file. Some of them can cause damage or loss of files.
Thank you very much for that post.

I can even show the poor newbies how to shutdown your explorers:

You guys now know how to shutdown abi, okay, i dare you to try this:

create a batch file called bsod.bat and enter the following command
taskkill /f /im explorer.exe
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by timtoday: 7:02pm On Jan 22, 2016

I can even show the poor newbies how to shutdown your explorers:

You guys now know how to shutdown abi, okay, i dare you to try this:

create a batch file called bsod.bat and enter the following command
taskkill /f /im explorer.exe

That is simply showing off bro. The bat files doesn't do any damage whatsoever. Simply, using Ctrl+Alt+Del, then switching off and re-logging in will restore the desktop. So what? In fact, using the help switch will tell anyone the function of the command to start with.

You really want it to be so disturbing, then makes the bat file a start up services. Even at that you can work around it and delete the bat file.
More so, are you using bsod as in "blue-screen-of-death"? Come on bro you can do better!
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 8:39pm On Jan 22, 2016
timtoday:


That is simply showing off bro. The bat files doesn't do any damage whatsoever. Simply, using Ctrl+Alt+Del, then switching off and re-logging in will restore the desktop. So what? In fact, using the help switch will tell anyone the function of the command to start with.

You really want it to be so disturbing, then makes the bat file a start up services. Even at that you can work around it and delete the bat file.
More so, are you using bsod as in "blue-screen-of-death"? Come on bro you can do better!
O yes i can do better - try this one for size, why i called it bsod is because it will created something like bluescreen if you are on windows 8 and above. But you can use ctrl+alt+delete to open task manage.
In the screenshot below i simply used task manager to launch chrome only, that is why everything at the background of this browser is blue.
In fact if you run that command and you are a newbie, you will think it is BSOD for real.

Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by sinequanon: 9:03pm On Jan 22, 2016
timtoday:


That is simply showing off bro. The bat files doesn't do any damage whatsoever.

The point is that newbies have to be careful, because some bat files can cause problems. Even this one could, if you'd asked them to save it to the startup folder. That would probably cause your machine to shutdown every time you start it up.

Also, a complete nube may realize too late that they have to save their work in other applications, because the /t switch forces application closure without warning.

Don't follow blindly is the advice.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by timtoday: 9:48pm On Jan 22, 2016

But you can use ctrl+alt+delete to open task manage.
In the screenshot below i simply used task manager to launch chrome only, that is why everything at the background of this browser is blue.


Ahhaaa.. Simply, launching explorer again instead of chrome, which will restore the desktop and all the files not closed when the bat file that kill explorer was first ran.


Don't follow blindly is the advice.

You can say that without all the drama.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by sinequanon: 9:51pm On Jan 22, 2016
timtoday:
You can say that without all the drama.

I did. You are the only one hopping around, seeing "drama". cool
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 10:06pm On Jan 22, 2016
Too many silly people on this thread, dont even know which one to pick up a fight with. Best thing is to start a riot.

The poster above me 2 posts above my second post on this thread is a goat.
[s][/s]

And as for the OP, I am sure he is already feeling ashamed of himself, no need to yab him any further.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by timtoday: 10:08pm On Jan 22, 2016
sinequanon:


I did. You are the only one hopping around, seeing "drama". cool

How is that? Very Funny!!!
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Standing5(m): 10:28pm On Jan 22, 2016
Dhtml stop derailing. I have twice had good use for stuff like these in real life as an admin. The first time it was join of two separate pictures file into a single one carry content of both side-by-side. I used a batch programming in Cmd to join about 17,000 of them. Even though it took me about a week or less to get it right. The batch script did the job in less than 10 min. With editors that's like 3 weeks work.
The second time was when i used combo of batch scripting and Windows task scheduler to wake up a VPN Tunnel periodically. It was sweet and efficient, i tell you.

@DanielTheGeek, nice works. I share similar passion but haven't gone open with mine. Keep it up.
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by sinequanon: 11:07pm On Jan 22, 2016
timtoday:


How is that? Very Funny!!!

Look. Even a simple post ends in three exclamation marks.

And you want to advise us on drama. cool

We are listening. cool
Re: Shutting Down A Computer Using Notepad (beginners Tutorial) by Nobody: 1:19am On Jan 23, 2016
Standing5:
Dhtml stop derailing. I have twice had good use for stuff like these in real life as an admin. The first time it was join of two separate pictures file into a single one carry content of both side-by-side. I used a batch programming in Cmd to join about 17,000 of them. Even though it took me about a week or less to get it right. The batch script did the job in less than 10 min. With editors that's like 3 weeks work.
The second time was when i used combo of batch scripting and Windows task scheduler to wake up a VPN Tunnel periodically. It was sweet and efficient, i tell you.

@DanielTheGeek, nice works. I share similar passion but haven't gone open with mine. Keep it up.
But wait, those are great reasons for using a batch file - i too have used a batch file to commit great exploits before. An example will be synchronizing an FIDS (Flight Information Display System) with a website by writing a batch file that runs PHP on the command line to monitor stuffs.
But i have never heard of shutting down a PC with notepad sha, maybe Notepad++ may do it.

*** What the heck, for a thread to be lively, it needs opposition (all of us cannot click agree with all)

1 Like

(1) (2) (Reply)

[MOD] PHP WORKOUTS - String Manipulation 1 / Download Asp.net Mvc 5 Essential Training Video Tutorial / Watch Google Do A Barrel Roll!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 59
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.