Nov 7, 2009
Pages: 1, 2, 3, 4

Shut Down, Restart, Log Off XP Using A Batch File - Undocumented feature for XP

free web hosting

Read Latest Entries..: (Post #31) by iGuest on Oct 17 2009, 02:28 PM.
Answer to above Shut Down, Restart, Log Off XP Using A Batch File ok well so what you do is, open notepad and type @echo off shutdown -s -t 30  what that does is shuts down your comp in 30 seconds, you can change the 30 to 10 if you like or 20.. Just letting you know.. It's seconds.. and if you want.. You could restart doing shutdown -r -t 30 or log off doign shutdown -l -t 30 so yeah, whichever one you want basically, use.. and if you wanna add a messag...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & Free Web Hosting > Computers & Tech > How-To's and Tutorials > OS > Windows

Shut Down, Restart, Log Off XP Using A Batch File - Undocumented feature for XP

NilsC
How to shutdown a XP Pro computer when you are connected using RDC (Remote Desktop Connection) using a batch file or RPC (Remote Procedure Command) This is useful if you can't get to the computer but have remote access to the computer via a network or the internet.

First To show you what you will see at a command prompt (command.com) when you type: "shutdown /?" Without the " " on each end. smile.gif

CODE
c:\>shutdown /?
Usage: SHUTDOWN [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "c
omment"] [-d up:xx:yy]

       No args                 Display this message (same as -?)
       -i                      Display GUI interface, must be the first option
       -l                      Log off (cannot be used with -m option)
       -s                      Shutdown the computer
       -r                      Shutdown and restart the computer
       -a                      Abort a system shutdown
       -m \\computername       Remote computer to shutdown/restart/abort
       -t xx                   Set timeout for shutdown to xx seconds
       -c "comment"            Shutdown comment (maximum of 127 characters)
       -f                      Forces running applications to close without warning
       -d [u][p]:xx:yy         The reason code for the shutdown
                               u is the user code
                               p is a planned shutdown code
                               xx is the major reason code (positive integer less than 256)
                               yy is the minor reason code (positive integer less than 65536)


This is an undocumented feature in XP so I have not found any writeup about it on M$ and everything used here is from other sources. Do not use "cmd" to start the command interpreter (cmd.exe), but type "command" for (command.com. Now you can shutdown the computer by typing "shutdown -s" or to restart the computer type "shutdown -r"

To create a batch file for this you can use notepad, and save the file as .bat in c:\ (root directory) Here are the 3 most used batch files for shutdown:
1 save as down.bat
CODE
shutdown -s

2 save as restart.bat
CODE
shutdown -r

3 save as forcedown.bat
CODE
shutdown -f

4 save as logoff.bat
CODE
shutdown -l

5 save as rpcdown.bat (replace computername with the name of your computer smile.gif )
CODE
shutdown -s -m \\computername
and this last one is fun in an enviroment using RPC smile.gif

So that's a piece of cake, the other options are self explanatory and if you need any help creating the batch file, ask and someone will help smile.gif

Nils

 

 

 


Comment/Reply (w/o sign-up)

vizskywalker
Any idea how to force a standby NilsC. I've been searching and so far no luck. Id that what the -f command does (I haven't actually tried that one yet, it seems to be just shutdown with a force quit of apps).

Comment/Reply (w/o sign-up)

NilsC
This may sound like a stupid question, it's not ment to be.

What do you mean by "force a standby" can you define what this term covers?

The -f forces a shutdown, the problem is it does not let programs finish and close in the normal way, it forces (terminates) them and shut the computer down. so any excel or other file you forgot to save is lost. Normal shutdown will prompt you to save a file -f bypasses all that.

Nils

Comment/Reply (w/o sign-up)

vizskywalker
By force a standby, I mean use a shortcut, command prompt command, batch file, whatever, something other than Start->Turn Off Computer->Standby to place the computer in standby mode. And, this is a long shot, I know, but do you know where the restart icon can be found?

Comment/Reply (w/o sign-up)

dungsport
Just want to make yours batch files more accessible and convenient to use. Just right-click on each of those batch files and assign a shortcut for it. Next time use it, just press the combination of keys that you have made.

Cheers

Comment/Reply (w/o sign-up)

vizskywalker
for even faster access, create a shortcut file for each batch and put them in a folder. Right click on the Taskbar and go to toolbars New Toolbar... pick the folder you have the shortcuts in. Then right click the toolbar and deselct show title and showtext to save space

Comment/Reply (w/o sign-up)

dtilford
Is there any way to make a batch file that will lock the computer? (Basically hit windows key+L).

Comment/Reply (w/o sign-up)

harriko
cool, thanks for this! its much more faster to double click a shortcut to a batch file to shutdom the computer or something, rather than click on the start, click on the turn off computer and then finally come to the three options to shutdown.

i would like to add, if you are really lazy like me you can make a shortcut and give the shortcut a global hotkey in the shortcut properties. it will be like "CTRL + ALT + (any key you like)" once you press these keys together it will shutdown, hibernate, restart, or standby the computer - simply with three buttons!

Comment/Reply (w/o sign-up)

enve19
This one will certainly come in handy as we work with nearly 400 computers on our network and it is difficult keeping up with which ones have remote access enabled.

Plus when we tell the staff to log out and they dont we can just chuck the batch file at them!!!

Thanks

Comment/Reply (w/o sign-up)

finaldesign
what priviledges must an computer connected to network have on remote computer to force that remote computer to shutdown? do that remote computer need's to have that
"allow remote assistance invitations to be sent from this computer" and
"allow users to connect remotely to this computer"
boxes checked?
unsure.gif

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
Answer to above
Shut Down, Restart, Log Off XP Using A Batch File

ok well so what you do is, open notepad and type

@echo off

shutdown -s -t 30 

what that does is shuts down your comp in 30 seconds, you can change the 30 to 10 if you like or 20.. Just letting you know.. It's seconds..

and if you want.. You could restart doing

shutdown -r -t 30

or log off doign

shutdown -l -t 30

so yeah, whichever one you want basically, use..

and if you wanna add a message there.. Which I tend to do sometimes

 

@echo off

shutdown -s -t 15 -c " Reformating your hardrive, shutting down 

=)_ 

-reply by lulz

 


Comment/Reply (w/o sign-up)

iGuest
TO Make Standby the PC
Shut Down, Restart, Log Off XP Using A Batch File

To make a shortcut for standby go to start click run and type notepad. Then copy the following code and paste it in your text file.

RUNDLL32.EXE PowrProf.Dll,SetSuspendState

After pasting the code click file save as. Then navigate to your desktop and save the file as, “standby.Bat” (include the quotes). If you forget the quotes you will have a file called standby.Bat.Txt.

Once you create the bat file you can put your computer in standby mode by just double clicking the newly created bat file. 

-reply by Rahmathullah

Comment/Reply (w/o sign-up)

magstuar
Here you can find a free ohmy.gif software tool for easy make remote computer shutdown, it is easy to use an it works on Windows 2000, XP and Vista

Free download at enc.idraconnectivesolutions.com web site:

http://enc.idraconnectivesolutions.com/

Comment/Reply (w/o sign-up)

iGuest
Easy and free way to make remote computer shutdown
Shut Down, Restart, Log Off XP Using A Batch File

Exits other tools for easy make remote computer shutdown, restart, logoff, and more. Here is one of the most easy to use and free for shutdown functions software.

Free software for remote computer shutdown download
You can find this software tool in enc.Idraconnectivesolutions.Com web page

-reply by Jones Smith

Comment/Reply (w/o sign-up)

ghoblin
Remote shutdown not work. why?
Please help me.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2, 3, 4
Similar Topics

Keywords : Shut Restart Xp Batch File Undocumented Feature Xp


    Looking for shut, restart, log, xp, batch, file, undocumented, feature, xp

See Also,

*SIMILAR VIDEOS*
Searching Video's for shut, restart, log, xp, batch, file, undocumented, feature, xp
advertisement



Shut Down, Restart, Log Off XP Using A Batch File - Undocumented feature for XP

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com