Computing.Net > Forums > Disk Operating System > Dos command for reboot

Dos command for reboot

Reply to Message Icon

Original Message
Name: Crash Override
Date: October 12, 2000 at 02:57:08 Pacific
Subject: Dos command for reboot
Comment:

Hey, Im wondering, whats the dos command for restarting or shut down the machine? Thanks


Report Offensive Message For Removal


Response Number 1
Name: Ginger Sankala
Date: October 12, 2000 at 05:25:13 Pacific
Reply: (edit)

There is no commands built into DOS for rebooting, though you might be able to find an utility to do such.

Gigner S.
www.coolgeeks.net - YOUR TECH HELP


Report Offensive Follow Up For Removal

Response Number 2
Name: Preston
Date: October 12, 2000 at 07:15:01 Pacific
Reply: (edit)

Here's the directions to create a warmboot.com file that will restart your computer. You'll need edit.com (or another text editor) and the DOS program "debug" to make the warmboot.com file. I've never tried it myself, so use it at your own risk.

Type the following eleven lines very carefully (*NOTE: line 6 should be blank), and save it as an ASCII text file in your default directory with the name WARMBOOT.TXT.

a 100
mov ax,40
mov ds,ax
mov word ptr [72], 1234
jmp ffff:0

r cx
10
n warmboot.com
w
q

After the WARMBOOT.TXT is made and saved, type the following line from DOS:
DEBUG < WARMBOOT.TXT

and press "Enter."
DEBUG.COM (one of your DOS files) then automatically reads the WARMBOOT.TXT file and makes a 16-byte file called WARMBOOT.COM. WARMBOOT.COM should be copied to the directory with your DOS files.


You can also download a different version of warmboot.com from this site:

http://www.missouri.edu/~eldjives/warmboot.zip


Report Offensive Follow Up For Removal

Response Number 3
Name: Rambler
Date: October 12, 2000 at 15:41:20 Pacific
Reply: (edit)

I have a little prog which does the above (30 bytes), I'll email it if you like. It needs to be in a directory in your PATH to work from anywhere else.


Report Offensive Follow Up For Removal

Response Number 4
Name: Laurence
Date: October 13, 2000 at 01:22:00 Pacific
Reply: (edit)

http://www.microsoft.com/kb/articles/q67/9/29.htm

1. HOW TO REBOOT IN A BATch
~~~~~~~~~~~~~~~~~~~~~~~~
Q: How do I reboot the PC from inside a batch file ?
A: ECHO G=FFFF:0 | DEBUG >NUL for MSDOS} these occasionally
ECHO GFFFF:0000 | SID >NUL for DRDOS} will give garbage
--------------------------------------------------------------
ECHO HPSË>REBOOT.COM This seems reliable, most editors
REBOOT.COM will allow Alt+203 to get the Ë
Hold the ALT key while 2 0 3 is
entered at the r/h keypad (Numlock ON)
--------------------------------------------------------------
This DEBUG script will produce COLDBOOT.COM when you run it
------------------------------------+ thus: DEBUG If your using BNU type: BNU /B |
If your using XDO type: XU BOOT | N COLDBOOT.COM
If your using 4DOS type: REBOOT | E 0100 48 50 53 CB 0D 0A
------------------------------------+ RCX
Flush your Disk Cache before you use| 0006
!!!! any of these methods !!!! | W
for Smartdrive this is: SMARTDRV /C | Q
=============================================================
These should work in MS-DOS 6.22/Windows 3.11. Use at your own risk.

:: warmboot.bat
@ECHO E 0040:0072 34 12 >%temp%.\reboot.dat
@ECHO G=FFFF:0000 >>%temp%.\reboot.dat
@DEBUG.EXE <%temp%.\reboot.dat >nul

:: coldboot.bat
@ECHO G=FFFF:0000 | DEBUG.EXE >nul

=============================================================
For Win 9x and NT (extracted from article in PC Magazine) ...

Close all programs and prompt you to log on:
rundll32.exe shell32.dll,SHExitWindowsEx

A complete system reboot, use the command line:
rundll32.exe shell32.dll,SHExitWindowsEx 2

Power down the system (for laptops):
rundll32.exe shell32.dll,SHExitWindowsEx 5

from other sources ...

rundll32.exe User.exe,ExitWindowsExec 5 % restarts %
rundll32.exe User.exe,ExitWindows % shuts down %

I believe the part after the commas may be case sensitive.


From MSDN:
-----------
rundll32.exe shell32.dll,SHExitWindowsEx n
...where n is one of the following...
0 - LOGOFF
1 - SHUTDOWN
2 - REBOOT
4 - FORCE
8 - POWEROFF

LOGOFF - Shuts down all running processes, then logs the
user off.

POWEROFF - Shuts down the system and turns off the
power. The system must support the power-off feature.

REBOOT - Shuts down the system and then restarts the
system.

SHUTDOWN - Shuts down the system to a point at which it is
safe to turn off the power. All file buffers have been flushed to
disk, and all running processes have stopped.

FORCE - Forces processes to terminate. When this flag is set,
Windows does not query running applications to inform them
that Windows is shutting down. This can cause the applications
to lose data, therefore, you should only use this flag in an
emergency.


==========================================================
* Closing a DOS window in Windows versions newer than 3.1x *

If it can be assures that the ANSI.SYS driver is not loaded and/or that
the background color of the window is black, then just add these two
commands at the end of the procedure ...

cls
@exit

BTW, a colored background is considered non-blank (set via an ANSI
string). If the desire is to be iron clad, even when ANSI.SYS is
loaded, use ...

for %%v in ("prompt $e[m" "echo on" cls) do %%v
@exit


Regardless of the status of the display, checking the 'Close on exit'
selection on the Program tab of a shortcut to the batch procedure will
ALWAYS cause the window to close.



Report Offensive Follow Up For Removal

Response Number 5
Name: Peer
Date: October 13, 2000 at 19:00:55 Pacific
Reply: (edit)

restart Dos computer: make sure aplications are closed and you are at the base Dos prompt (Type "exit" until you get this)then press and hold ctrl+alt+delelte then release if this doesn't work press the reset button on the case.

To shut down: Get to the base prompt described above, hit the power switch


Report Offensive Follow Up For Removal


Response Number 6
Name: Fred6008
Date: October 14, 2000 at 10:09:11 Pacific
Reply: (edit)

Press the CTRL, the ALT and the DEL keys all at the same time to reboot. Turn off the power switch to shutdown. Only if you want to reboot from a batch file does it get complicated.


Report Offensive Follow Up For Removal

Response Number 7
Name: Buhawi
Date: October 22, 2000 at 12:13:11 Pacific
Reply: (edit)

make a text file with only this line:

@echo off

then save as 'reboot.com' -- works for my msdos 6.22, no asm or debug necessary and only 9 bytes long!!!


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Dos command for reboot

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge