|
|
Shut Down, Restart, Log Off XP Using A Batch File - Undocumented feature for XP | ||
Discussion by NilsC with 33 Replies.
Last Update: January 7, 2010, 1:17 am (View Latest) | Page 1 of 3 pages. | ||
First To show you what you will see at a command prompt (command.com) when you type: "shutdown /?" Without the " " on each end.
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 -s2 save as restart.bat
CODE
shutdown -r3 save as forcedown.bat
CODE
shutdown -f4 save as logoff.bat
CODE
shutdown -l5 save as rpcdown.bat (replace computername with the name of your computer
CODE
shutdown -s -m \\computernameSo 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
Nils
Thu Mar 24, 2005 Reply New Discussion
Cheers
Fri Mar 25, 2005 Reply New Discussion
Sat Mar 26, 2005 Reply New Discussion
Thu Mar 24, 2005 Reply New Discussion
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
Thu Mar 24, 2005 Reply New Discussion
Thu Mar 24, 2005 Reply New Discussion
Tue Apr 19, 2005 Reply New Discussion
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!
Mon Apr 25, 2005 Reply New Discussion
Plus when we tell the staff to log out and they dont we can just chuck the batch file at them!!!
Thanks
Tue Oct 11, 2005 Reply New Discussion
"allow remote assistance invitations to be sent from this computer" and
"allow users to connect remotely to this computer"
boxes checked?
Tue Oct 11, 2005 Reply New Discussion
-vikas sinha
Thu Nov 1, 2007 Reply New Discussion
I did a Google search to find some batch codes to specifically and only Save/force a shut down of a specific Excel file name and re-open the same Excel workbook.
Can someone help out please ?
Excel will freeeze on some occasions and I have a On Error in VBA module, so when it does error, it needs to shutodown and re-open.
I can take care of the macro when the workbook opens again, but not sure how a batch file can automatically do the shutdown and re-open task.
Thanks.
Tue Dec 4, 2007 Reply New Discussion
1) Does this work on XP Home or tablet/media center edition?
2) Is there something for W2k or Vista?
3) Can you shutdown everybody in the network - what are the setting that have to be setup on the other PC's - services, permissions, etc.?
4) I've tried created shorcuts which could be copied to clients with little success - is there a 3rd party program which can make shortcuts for different windows versions?
5) Is there a way to make the key shorcuts CTRL + ALT + ?? to a file.reg that can be added when needed and removed afterwards?
6) How about logoff current user, and take screenshots?
6) How about has anyone tried creating the batch files, installed them remotely via .reg files, and created scheduled tasks to implement them?
Well I don't know where I'm getting at - just thinking out loud. But here is some homework for you. Let me know if you have any success. If I don't have anything to do this week I'll look into it.
Levimage
Wed Dec 5, 2007 Reply New Discussion
Wed Dec 5, 2007 Reply New Discussion
QUOTE (polarysekt)
what about one of the scripting engines.... like VBScript???Link: view Post: 114815
Yes, whatever works, but how does it work ?
Some of us are no bertter than recording a macro and some tweaks thereafter, and to be honest, that's too much !
Wed Dec 5, 2007 Reply New Discussion
Optimizing Your Pc For... Anything Really Want your PC to fulfil it's potenial? (4)
|
(0) Registry
|
Index




