Login Register






Create One-Click Shutdown and Reboot. filter_list
Author
Message
Create One-Click Shutdown and Reboot. #1
Simple & Basic Tutorial on How To Create One-Click Shutdown and Reboot Batch File


Introduction:
Batch file is the name given to a type of script file, & a text file containing a series of commands to be executed by the command interpreter.
batch files must have to be saved with ".bat" Extension.

This Batch file Executes Events such as: Shut Down, Reboot, Log Off, on a Windows XP OS.:Smile:



Steps:


  1. Create a New Text File on your Desktop named as "shutdown" , Now This is non-executable file.
  2. Now Type Or Paste Below Batch code in that New Text file.
  3. Now Save file as "Reboot.bat" This is executable file.
  4. Make Sure that You have created a New executable File named as "AnyName.bat" :Smile:
  5. Now Double click on "Reboot.bat" and Whooo It will display the message "Rebooting your PC." & will Reboot After Ten-second delay.
  6. The Reboot command includes a variety of switches you can use to customize it. Below List 1-6 lists all of them and describes their use.. :Smile:
  7. You can definitely Modify Time,Event & Message of your event.

Code:
shutdown -r -t 10 -c "Rebooting your PC"

Other Switches that We can include in our Files are as Follows:


  1. -s
    Shuts down the PC.

  2. -l
    Logs off the current user.

  3. -t nn
    Indicates the duration of delay, in seconds, before performing the action.

  4. -c "message text"
    Displays a message in the System Shutdown window. A maximum of 127 characters can be used. The message must be enclosed in quotation marks.

  5. -f
    Forces any running applications to shut down.

  6. -r
    Reboots the PC.
I know This is just a Basic code & i am Posting It for Newbies..... :Innocent:
Hope You Like it :Smile:


I will Soon Back with a Collection of New,Cool, & Helpful Tricks!! :Smile:
Thanks:Smile:

Reply

RE: Create One-Click Shutdown and Reboot. #2
This is a pretty common trick but I like that you took the time to explain it Biggrin
You can also just use a rainmeter module.
[Image: mGs7EEq.png]
Skin: Bluevision alpha 0.2
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Create One-Click Shutdown and Reboot. #3
Yes You are Right, It's really a common Trick.....
I am Working on a New Useful Tricks.:Smile:

Reply

RE: Create One-Click Shutdown and Reboot. #4
You can also do this remotely to other computers on the same network by adding the -m attribute.
Some systems though you'll need to enter a password or it won't allow access.
I've been experimenting a lot with this recently. Smile

Reply

RE: Create One-Click Shutdown and Reboot. #5
Holy crap @Cheshire that's awesome! I didn't know about that so I guess it's time to get crackin'!
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Create One-Click Shutdown and Reboot. #6
(03-04-2014, 10:59 PM)w0lf Wrote: Holy crap @Cheshire that's awesome! I didn't know about that so I guess it's time to get crackin'!

An easy way to mess with some people if you share the same network as is to first
Code:
net view
to see who is connected to you network and get the system name

then, once you have the system name, you can use the shutdown command

Code:
shutdown -m \\[comp name] -s [to shutdown or -r to restart] -t [time warning] -c [even add a message]

You can also use
Code:
shutdown -m \\[comp name] -a
to abort the shutdown if you've given a time warning.

Again, some computers will have firewalls up to prevent this, or you need to enter a password, but it works great at my college where we still use XP and its easy to have remote access across the network. You can also have some fun with TASKLIST and TASKKILL commands to shut down friend's web browsers or other programs without warning. :Laughing:

Reply

RE: Create One-Click Shutdown and Reboot. #7
Hahaha thats great! multiple thanks to you @Cheshire
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Create One-Click Shutdown and Reboot. #8
Thanks For your Appreciation & More Advance Tips On CLI Tricks......
Many thanks to w0lf & cheshire :Smile:
Nice work cheshire:Thumbs-Up::Smile:

Reply

RE: Create One-Click Shutdown and Reboot. #9
Thank you, @0wi5py. Smile

Reply

RE: Create One-Click Shutdown and Reboot. #10
Quote:batch files must have to be saved with ".bat" Extension.

Not true, they can be saved with the *.cmd extension as well, and it's required in some cases to save with that extension.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply