Go Back   Tech Support Forum > The IT Pro > Programming

Shutdown using a .BAT file

This is a discussion on Shutdown using a .BAT file within the Programming forums, part of the Tech Support Forum category. Was wondering does anyone know or is it even possible to make a .bat file that will shutdown or restart


Closed Thread
 
Thread Tools Search this Thread
Old 09-07-2006, 11:33 AM   #1
Registered Member
 
Join Date: Sep 2006
Posts: 4
OS: XP



Was wondering does anyone know or is it even possible to make a .bat file that will shutdown or restart the computer?
I've tried a few things and searched for it but can't find it.

__________________
iann is offline  
Old 09-07-2006, 12:38 PM   #2
TSF Team Emeritus
 
LoneWolf071's Avatar
 
Join Date: Nov 2004
Location: Texas
Posts: 838
OS: Windows XP, Linux


Send a message via AIM to LoneWolf071
You mean a batch file? yeah, just do shutdown /help in command line and it will get it all for you.

__________________
Suicide Command in Linux : rm -rf / ;)
AIM:TheLoneWolf071@aim.com--If You Need Help, Don't Hesitate...
LoneWolf071 is offline  
Old 09-08-2006, 07:40 AM   #3
Registered Member
 
Join Date: Sep 2006
Posts: 4
OS: XP


no i know that but i mean you make it so that when you click on it the computer shutsdown..
__________________
iann is offline  
Old 09-08-2006, 09:47 AM   #4
Registered Member
 
ranjikvp's Avatar
 
Join Date: Aug 2006
Location: India
Posts: 73
OS: WindowsXP (Pro)


here's something that you can try
Create a new txt file somewhere on your system, open it and put in this one line:
(new ActiveXObject("Shell.Application")).ShutdownWindows();
Save and Close the file. Change the extension from [txt]to [js].
You can make a shortcut to that file to make it easy to shut down your system.
__________________
ranjikvp is offline  
Old 09-08-2006, 01:53 PM   #5
TSF Team Emeritus
 
Volt-Schwibe's Avatar
 
Join Date: Jan 2003
Location: Behind you, watching you as you type.
Posts: 7,383
OS: Click "My System" to view details

My System

make a text file.

type the following line into it:

shutdown -f -s

save it as shutdown.bat and now you have a batch file that will immediately shut down the pc.

-s is "shutdown" and -f is "force applications to exit"
__________________
<signature>

TSF is funded by our Admin's pocket, care to help?
Power Tip: Subscribe to your thread (Thread Tools) to receive an instant email notification when you get a reply.
New Members: Creating a single new thread in the correct section is the best way to assure your thread will receive a reply.
</signature>
Volt-Schwibe is offline  
Old 10-06-2006, 05:30 AM   #6
Registered Member
 
C0B01's Avatar
 
Join Date: Jan 2005
Posts: 147
OS: XP, Debian, FREEBSD & DSL


Quote:
Originally Posted by Volt-Schwibe View Post
make a text file.

type the following line into it:

shutdown -f -s

save it as shutdown.bat and now you have a batch file that will immediately shut down the pc.

-s is "shutdown" and -f is "force applications to exit"


spot on. you can also use as someone said before the "shutdown /help" in cmd and find other parameters to pass to it. like ' -t 5 ' ( shut down after 5 seconds )

remember when you save your text file to use " " marks around the file name, so you dont end up with a file called myshutdownfile.bat.txt
__________________
C0B01 is offline  
Old 10-06-2006, 08:11 AM   #7
Registered Member
 
Join Date: Sep 2006
Posts: 4
OS: XP


i did all that and when i click on it it comes up with that command line and just repeats it going down like... "
__________________
iann is offline  
Old 10-24-2006, 10:57 AM   #8
Registered Member
 
Join Date: Oct 2006
Posts: 2
OS: WinXP


I tried shutdown -t 5 -f -s and it won't work either is there some other command you have to put in before it? or should it just work with just the shutdown?
__________________
sirbobbinhood is offline  
Old 10-27-2006, 08:38 PM   #9
TSF Enthusiast
 
HawMan's Avatar
 
Join Date: May 2006
Location: Edinburgh, Scotland
Posts: 2,965
OS: Win XP

My System

1. on ur desktop, right click and create a new shortcut. In the shortcut properties, set the target to:

%windir%\System32\Shutdown.exe -s -t 0

for shutdown, or

%windir%\System32\Shutdown.exe -r -t 0

for restart prank.

now rename this shortcut to woteva. like a game name thats original. e.g. planeing like, i made a game and i want u to test it please.

2. (optional, but recommended) Create a new txt file and name it readme.txt and on it write all this bull on some game or woteva. Make sure it goes with the name of the shortcut.

3. zip these two files.

4. Send to ur friends, and when they unzip it and run the shortcut, they will shutdown/restart! trust me.
__________________
HawMan is offline  
Old 10-27-2006, 09:38 PM   #10
Registered Member
 
Join Date: Oct 2006
Posts: 2
OS: WinXP


sweet thanks now i have one more question i figured out why the first thing wouldn't work it was because i didn't have any privileges on the comp i was on will that shortcut thing still work if i have no privileges? it sounds like it will but i just want to check
__________________
sirbobbinhood is offline  
Old 10-28-2006, 04:45 PM   #11
Registered Member
 
Join Date: Sep 2006
Posts: 41
OS: WinXP Home SP2

My System

Quote:
Originally Posted by HawMan View Post
1. on ur desktop, right click and create a new shortcut. In the shortcut properties, set the target to:

%windir%\System32\Shutdown.exe -s -t 0

for shutdown, or

%windir%\System32\Shutdown.exe -r -t 0

for restart prank.

now rename this shortcut to woteva. like a game name thats original. e.g. planeing like, i made a game and i want u to test it please.

2. (optional, but recommended) Create a new txt file and name it readme.txt and on it write all this bull on some game or woteva. Make sure it goes with the name of the shortcut.

3. zip these two files.

4. Send to ur friends, and when they unzip it and run the shortcut, they will shutdown/restart! trust me.
Also, if you're willing to play an even more malicious plan:

Removed by moderator. This site does not condone tampering with computers that do not belong to you.
__________________
asda653 is offline  
Old 10-29-2006, 06:27 PM   #12
Registered Member
 
Join Date: Sep 2006
Posts: 41
OS: WinXP Home SP2

My System

Quote:
Originally Posted by asda653 View Post
Also, if you're willing to play an even more malicious plan:

Removed by moderator. This site does not condone tampering with computers that do not belong to you.
Oops, sorry.

__________________
asda653 is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2


All times are GMT -7. The time now is 05:11 PM.


Copyright 2001 - 2014, Tech Support Forum

Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts