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

Pages: 1, 2, 3
free web hosting

Read Latest Entries..: (Post #23) by iGuest on Jun 25 2008, 01:03 AM. (Line Breaks Removed)
PortableApps Shut Down, Restart, Log Off XP Using A Batch File Did you know that if you have the latest version of the portableapps menu, and a program called QuickBFC, you can put this .Bat file on your USB and use it on any computer by clicking on the button in the menu.-reply by redisforever
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

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

 

 

 


Reply

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).

Reply

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

Reply

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?

Reply

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

Reply

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

Reply

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

Reply

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!

Reply

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

Reply

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

Reply

Latest Entries

iGuest
PortableApps
Shut Down, Restart, Log Off XP Using A Batch File

Did you know that if you have the latest version of the portableapps menu, and a program called QuickBFC, you can put this .Bat file on your USB and use it on any computer by clicking on the button in the menu.

-reply by redisforever

Reply

iGuest
RE timed reboot bach file
Shut Down, Restart, Log Off XP Using A Batch File

To have a pop up box right before shutdown you type the code -c in the code like below :

Shutdown -f -t 60 -c "this is where the pop will arise"

Play around with it and I hope it answers your question!

-reply by h4ox3r

Reply

iGuest
Spamming by shutdown :O
Shut Down, Restart, Log Off XP Using A Batch File

When I use the command
" Shutdown -f "
Is just spamming
" shutdown -I -s -f -t 20 "
All the time, and nothing happens, why?

- Windows xp ( PRO ), sp2

Reply

iGuest
Replying to vizskywalker

Did you every get an anwser regarding how to force standby mode from a batch file?

Thanks,
Shawn

-reply by Shawn Moorman

Reply

J.C.
You can also play a hilarious prank with this.

>Right click on the Desktop
>Choose New
>Choose Shortcut
>Type "shutdown.exe -s -t 60 -c "THIS COMPUTER HAS DETECTED A VIRUS!" (Without the quotes, 60 is the amount of time before the command initiates so it can be modified and the text in the quotes (the quotes around THIS COMPUTER HAD DETECTED A VIRUS are needed by the way) can be modified.
>Once you are finished typing that, click ok
>Right click the shortcut on the Desktop
>Click Properties
>Go to "Change Icon"
>A message will appear, just click OK.
>Scroll to the Internet Explorer icon.
>Select it and click ok.
>Click ok.
>Now, if you delete the original Internet Explorer Icon, and change the name of your new shortcut to Internet Explorer, you can play a hilarious prank on someone by making them think their computer has a malicious virus! I've done it on my teachers. It's very funny.

Reply


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*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2, 3
Recent Queries:-
  1. shutdown batch codes - 0.15 hr back. (1)
  2. shut down batch command - 0.22 hr back. (1)
  3. shutdown batch command - 0.88 hr back. (1)
  4. logoff users bats files - 0.89 hr back. (1)
  5. shut down computer from bat file in xp - 0.92 hr back. (1)
  6. shutdown batch code - 1.04 hr back. (1)
  7. shutting down your computer with a batch file - 2.20 hr back. (1)
  8. batch file restart computer xp - 2.71 hr back. (1)
  9. shutdown batch file - 1.32 hr back. (2)
  10. batch file restart explorer - 3.41 hr back. (1)
  11. log off batch - 3.45 hr back. (1)
  12. shutdown batch file xp - 3.56 hr back. (2)
  13. batch file force shutdown - 3.62 hr back. (1)
  14. forcing remote computer to standby - 3.68 hr back. (1)
Similar Topics

Keywords : shut, restart, log, xp, batch, file, undocumented, feature, xp

  1. Css File Size
    (7)
  2. Video Feature?
    (1)
    Hey guys, Im new here, and I wanted to know if the astahost free sites (the ones you need credits
    for) have the option to upload videos, and create custom pages for certain people. Im wanting to
    start my own website for gaming. After this summer's work with weddings and honeymoons, ive
    racked up enough cash to consider something new. I want to start a website to hold gaming
    tournaments. For the website, id like to upload videos, and a bunch of other info. When people open
    the site, id like for an intro movie to come up. Then after, id like to have a gallery of differ....
  3. Mysql And User File_priv
    (0)
    HI, I've hit the grain while trying to import file to mysql database - I need to enable file
    permissions of the database user but this seems not possible with most of the hosting providers.
    The problem is to set file_priv of the database user to "Y" . This is done in the "user" table of
    the maintanance database named "mysql". cPanel doesn't allow this. Via the cPanel you can only
    allow privileges on table querries but you cannot grant host file privileges to the database user -
    which makes querries like: "LOAD DATA INFILE 'filename' INTO TABLE tablen....
  4. Re-ordering Welcome Screen & Moving Heavily Fragmented File
    (1)
    On this computer the two accounts are Lane Family and Toby Lane. Can I move the second to the top
    without renaming either, or with some hidden character? Are there any commonly fragmented files
    that I can move (say to a usb drive), or should I start worrying about the bios battery or hard disk
    or any other parts of this 11-ish year old computer failing?....
  5. Need To Edit A Wav File [solved]
    can you recommend me a free software ? (1)
    Hi, For ringtone purposes, I need a wav file smaller than 2 megs. This means editing my favourite
    song, and shorten the wav file to the first seconds of the intro in order to be less than 2 megs.
    Could you please recommend me a soft able to do that ? Easy to use and free if possible ? Or a
    commercial one having a trial version ? Thanks in advance Yordan ------------------ Edit : OK,
    Audacity did perfectly the job. I leave this post here, maybe this info could be useful for somebody
    else.....
  6. Linux Basic Command - For Storing Compilation Error To File
    (1)
    Ex: Compiling a cpp file using a basic command " g++ filename.cpp " and to run the program use
    ./a.out , Then to store the compilation error to text file use this command. g++ test.cpp >
    log.txt log.txt contains the compile time errors. ....
  7. How To Copy File & Folders From Linux To Windows?.
    (12)
    Many face problem while transfering file from Linux to windows and Vise versa. My solution for
    this is "winscp405". Winscp is a windows freeware tool used to copy file from & to Linux machine.
    To get this tool just google for " winscp405" tool and download this small package and install.
    Enjoy working with Linux and windows /tongue.gif" style="vertical-align:middle" emoid=":P"
    border="0" alt="tongue.gif" />....
  8. Safari And Hosts File
    Overriding the file?? (8)
    I found this to be quite alarming when I found that sites I blocked using HOSTS were still
    accessible by Safari. My HOSTS file consists of many automatically added entries by Spybot S&D and
    SpywareBlaster and similar programs, but I also have some user added entries also. It is a 228KB
    file, and a small segment that I added looks like this: 127.0.0.1 myspace.com 127.0.0.1
    www.myspace.com 127.0.0.1 ca.myspace.com I found it to be inaccessible by all user accounts
    using Firefox, Internet Explorer, Opera and Flock. However, I tried accessing it using Safari an....
  9. Problem With Move_uploaded_file()
    Permission denied? (5)
    CODE Warning: move_uploaded_file(images/profile/Mordent.jpg)
    [function.move-uploaded-file]: failed to open stream: Permission denied in
    /home/mordent/public_html/withvalour/edit_image.php on line 42 Warning:
    move_uploaded_file() [function.move-uploaded-file]: Unable to move
    '/tmp/phpOWVz7o' to 'images/profile/Mordent.jpg' in
    /home/mordent/public_html/withvalour/edit_image.php on line 42 Any ideas? The code seems fine,
    as it works a treat when I run it locally (on WAMPServer), but as soon as I tr....
  10. Is A Php File Searchable?
    (8)
    Hi, I have made my web site solely stored in a SQL database...that will say if I need to load a
    page I take it our from the data base and then display it. My question is: is any searcg engine
    able to ``crawl'' into my web site content? I would appreciate some info so that I
    can change the way my web works. ....
  11. Messed Up My Boot.ini File With Vista...
    How can i fix it? (13)
    I wanted to install Vista without getting rid of my XP installation, so I left Xp on my C drive, and
    installed Vista on another physical disk. I started running into problems with the dual booting when
    i would switch from one OS to the next, and after a while Xp would start hanging on boot, and only
    after several cold reboots would it load properly. So i was planning on uninstalling Vista, but the
    hard drive i had it on got formatted by a friend of mine who thought he was doing me a favor. Now
    when i switch on the computer i get the OS choice menu, typical Vista pre-sele....
  12. Need Help Urgently (missing Or Corrupt Hal.dll File).
    (6)
    I attempted to boot up my younger brothers computer dismorning, only to be greeted by an error in
    white texton a black screen (before windows starts up) claiming that hal.dll was missing or corrupt.
    I am not entirely sure what happened, but my searches have lead me to believe that my little sister
    may have accidentaly edited the boot.ini file (hopefully not removing it's contents as I
    don't remember how I set it up when I had trouble last time). I am wondering if anyone knows of
    a simple single floppy boot disk that I could use to edit text files on the drive s....
  13. Deleting A Corrupt File
    Cannot delete a corrupt file on Windows XP... (26)
    I was upgrading some software and came across a corrupt file that halted the installation process. I
    went to see what was wrong with the file, and failed to manually delete it. I tried moving
    (cut&paste) it to another location, and the installation succeeded. However, the file is still on my
    drive, taking up a KB of space. I know that's not a lot, but where am I supposed to put it? In a
    folder created especially for all the corrupt files on my computer? /blink.gif"
    style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> I've heard
    something....
  14. How Do You Use The cPanel File Manager?
    How to use File Manager? (14)
    I feel stupid for asking this but I can’t figure out how to use file manager. How do you
    open folders and view the file in it? When I click on a certain folder the options does not include
    opening it. And can you upload file from the file manager? I’ve been using FTP to manage my
    files so far. ....
  15. How To Create Exe File In Java?
    (13)
    Dear friends I came to know that one can build exe files from java application. How this is
    possible? According to me there is no such method in java to cerate exe files. However Microsoft
    used to provide a free system development kit (SDK), for Java, which includes the jexegen tool. But
    one need install Microsoft Java Virtual Machine to run such application. Some people suggest
    InstallAnyWhere.....
  16. Google Suggest (beta)
    New Google's Search Auto-Complete Feature... (10)
    Lately, Google has been producing so many useful tools and utilities, not to mention its amazing
    search capabilities. Many of those new tools pass through a long phase of BETA testing to ensure
    that they reached their optimum usefulness and are ready to be put to use by the masses. So now,
    Google has released a BETA version of one more tool, called Google Suggest!... You know how
    many of today's Web browsers have an auto-complete feature, where you type a few letters and
    that application tries to recognize the phrase you're typing and complete it for you....
  17. Get User Input From Vbscript For Batch Files
    Get user input from vbscript (2)
    Hello, I didn't see a tutorial on this subject so i'll go ahead and do it. Long ago I used
    batch file programming a quite a bit. I used vbscript files to get user input for the batch files.
    So here is a simple example of using the 'call' command to call for the vbscript file which
    should be in the same folder as the .bat file. in the batch file pretty much anywhere you can start
    the vbscript, and call another .bat file- using @ to of course not echo the line of code - CODE
    @ start /w wscript.exe userin.vbs @ call ~anyname.bat @ del ~anyname.bat....
  18. You Cannot Create A File Named Con
    (9)
    did you know, that on MS Word, you cannot name a document con? nobody can figure out why!
    ....
  19. Super File Recover
    (3)
    SUPERFileRecover 3.0.0.1052 SUPERFileRecover can recover deleted Files, Documents, Spreadsheets,
    Pictures, Movies, and Music easy! SUPERFileRecover utilizes read-only scanning so that the data
    on your drive remains intact no matter how many times you scan and attempt recovery! SUPER
    File Recove features When a file is deleted the file may still exist on the drive from which it
    was deleted even if you have emptied the recycle bin. With SUPERFileRecover you can often recover
    the entire file completely intact, saving hours of work reproducing a document, red....
  20. How To Use Psd File
    (14)
    I'm redesigning my website, and I found a template for it that is in a PSD format. I have Adobe
    Photoshop so I can open it and edit it. I changed the text and images exactly the way I want it, but
    what do I do from here? How do I get the images and text from the PSD to the individual files that
    makes it up? Or am I supposed to be doing that at all? Thanks....
  21. Uploading Image File Through JSP Code To Server
    (9)
    I have to upload images from client side to server side, without using input tag or browseing of
    file. I know the absolute path of file in client side. And that file I want to shift to server with
    JSP code or any servlet code. I have done uploading through servlet to the server with input tag
    and type is file . Servlet code : CODE import com.oreilly.servlet.MultipartRequest;
    import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public
    class UploadPhoto extends HttpServlet { public void doPost(HttpServletRequest req....
  22. Rapidshare
    Free File Hosting (1)
    Rapidshare Upload limit: Unlimited Download limit: Unlimited Excellent file hosting/storage
    site. FAST uploads and downloads. Highly recommended! Tell me what you think! This topic
    has been posted on several times earlier. Use SEARCH before posting. If you want to discuss about
    this hosting service, follow up on the older threads. Topic closed. ....
  23. What Is Mkv? Need Help With This File Format?
    (7)
    I've download a movie, but I don't know how to open it. What's MKV format. Never used
    that before. This is the file name : Final_Fantasy_VII_Last_Order_v2.DVD(H264.AAC) .mkv I'm
    very excited to watch the movie. So, please reply as soon as possible. Please include information
    about the codec in your post. Where to download the codec ?....
  24. Switch Network Settings With Batch Files
    A quick way to change IP, Gateway, DNS (18)
    Let's suppose you are using two network settings with your laptop frequently. Wether it's a
    wireless or wired network, all the same: Every time you want to change the IP, subnet mask, default
    gateway and DNS Server(s) of your network connection in any flavour of Windows, you have to click
    through menus, submenus, and from that you go to yet another submenu... you have been there,
    it's awful. /mad.gif' border='0' style='vertical-align:middle' alt='mad.gif' /> There is a
    better way: the command "netsh" on your command prompt can change all the aforementio....
  25. Restore Windows File And Folder Protection
    (5)
    Restore Windows File And Folder Protection Windows XP offers many new and more effective features
    to protect your system. For example, Windows hides files and folders stored on Windows, Program
    files and system directory to protect them from being changed or deleted. When you want to open
    system folders for first time, windows displays below screen These Files Are Hidden This folder
    contains files that keep your system working properly. You should not modify its contents Show the
    contents of this folder If you click on “Show the contents of this folder” in left p....
  26. Text File Operations VB.NET
    (5)
    In this tutorial you will learn most of the operations you can use on a text file. They include
    finding if a file exists, opening/creating a file, reading/writing file, closing file, copying
    file, deleting file. You will need a form with two buttons on it. Use the names Step1 and Step2.
    First thing we are going to do is import system.IO. To do this go into the forms code view. At
    the very top add this line. CODE Imports system.IO This lets us use the file operations
    that we need for this tutorial. Next we need to check to see if a file exists. To ....
  27. Recover Tables From A MySQL .frm File
    (8)
    I have a couple of .frm files with no corresponding data or index files. Is it possible to recover
    the table structure (field names, types, sizes, rows,col, etc) from these files? The table type is
    innodb....
  28. Counter With Img In Flat File
    (2)
    this is a counter with images and stor in flat file becouse i can not upload .zip .rar file iwell
    program it on this post at frist you need to 2 files count.php count.txt and you need else make
    folder has name gifs and make 10 pictuer 10 file 0.gif to 9.gif now all ok open the count.php and
    add this code CODE <? ### IMAGE FORMAT $format = ".gif"; $file =
    file("count.txt"); $num = ($file[0] + 1);
    exec("echo $num > count.txt"); switch($type) { case "....
  29. How To Save A Image In Pdf File And Download It?
    Programming script need hepl. (10)
    Can anyone tell how to save an image into a PDF file and download it without need to save it on the
    server? Thanks. All sugesstions are welcome! Wrong section. Topic moved to Software >
    Graphics & Web Design. ....
  30. How Do I Compress One File Into Several Parts?
    Using Winrar (10)
    Ok, i have a 70 mb folder compressed with winrar, and i tried to uploaded into a "service" on the
    internet, but they only allow uploads up to 10mb.. That's why i need to upload the folder in 7
    equal parts of 10mb each... I know it's possible in winrar beacuse i have downloaded files with
    this specs (separated, like a back-up) So, if u know how to, please tell me Thanks!....

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

*RANDOM STUFF*





*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



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE