![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-17 11:24 |
47,814 topics / 349,905 posts / today 2 new / 48,259 members |
| DOS疑难解答 & 问题讨论 (解答室) » How to restart the computer by entering a command in Start - Run |
| Printable Version 2,536 / 16 |
| Floor1 lhy1836 | Posted 2005-08-30 21:22 |
| 初级用户 Posts 11 Credits 22 | |
|
How to use the method of entering a command in Start - Run in WIN98 to make the computer restart by itself.
|
|
| Floor2 Climbing | Posted 2005-08-30 21:54 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
It seems that you need to use the rundll32 program to call functions in the system dynamic link library to achieve it. I forgot the command line, so I'll search with Google.
I used Google to search with these keywords: "windows 98" rundll32 shut down computer I found the answer in the first result, that is, Start -> Run: RUNDLL32.EXE USER.EXE,EXITWINDOWS OK! |
|
| Floor3 Climbing | Posted 2005-08-30 21:59 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
Mistook the LZ's meaning. The LZ wants to restart, then the command is:
RUNDLL.EXE user.exe,exitwindowsexec Also found by searching with Google. |
|
| Floor4 lhy1836 | Posted 2005-08-30 22:25 |
| 初级用户 Posts 11 Credits 22 | |
|
Thank you, two masters. Then if I want to put these commands in a batch file, how should I handle it?
|
|
| Floor5 lhy1836 | Posted 2005-08-30 23:01 |
| 初级用户 Posts 11 Credits 22 | |
|
I also found it. Use Rundll32.exe Shell32.dll,SHExitWindowsEx 2.
Explanation: Parameter 0 means log off, 1 means shut down, and 2 means restart the computer. This way, all problems are solved. |
|
| Floor6 brglng | Posted 2005-08-31 09:24 |
| 银牌会员 Posts 466 Credits 1,200 From 上海 | |
|
Detailed Explanation of RUNDLL.exe Command (Repost)
Friends who often use Windows 9x must be familiar with the two files Rundll32.exe and Rundll.exe. However, since the functions of these two programs were originally only for internal use within Microsoft, there must be very few friends who really know how to use them. Well, if you are not clear about it, then let me tell you. First of all, please do a small experiment (please save the results of the program you are running in advance, otherwise...): Click "Start - Programs - Ms-Dos Mode" to enter the Dos window, then type "rundll32.exe user.exe,restartwindows", and then press the Enter key. At this time, you will see that the computer is restarted! How about it, is it interesting? Of course, the function of Rundll is not just to restart your computer. In fact, Rundll, as the name suggests, executes Dll. Its function is to call the Windows dynamic link library in the command line. The difference between Rundll32.exe and Rundll.exe is that the former calls 32-bit link libraries, and the latter is used for 16-bit link libraries. Their command format is: RUNDLL.EXE <DLL name>,<entry point> Three points should be noted here: 1. There should be no spaces in the Dll file name. For example, if the file is located in the c:\Program Files\ directory, you need to change this path to c:\Progra~1\; 2. The comma between the Dll file name and the Dll entry point cannot be omitted, otherwise the program will be wrong and no information will be given! 3. This is the most important point: Rundll cannot be used to call Dlls containing return value parameters, such as GetUserName(), GetTextFace() in Win32API. In Visual Basic, there is an instruction Shell for executing external programs, and the format is: Shell "command line" If you can use the Shell instruction well with Rundll32.exe, it will make your VB program have effects that are difficult or even impossible to achieve with other methods: still taking restart as an example, the traditional method requires you to first create a module in the VB project, then write the declaration of WinAPI, and finally call it in the program. But now it's done with just one sentence: Shell "rundll32.exe user.exe,restartwindows"! Isn't it much more convenient? In fact, Rundll32.exe has unique advantages in calling various Windows control panels and system options. Next, I will list the relevant Rundll commands I collected on the Internet as follows (very useful, it can save you a lot of time in calling Windows API!!), for everyone to refer to in programming: Command line: rundll32.exe shell32.dll,Control_RunDLL Function: Display the control panel Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1 Function: Display the "Control Panel - Accessibility Options - Keyboard" option window Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2 Function: Display the "Control Panel - Accessibility Options - Sound" option window Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3 Function: Display the "Control Panel - Accessibility Options - Display" option window Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4 Function: Display the "Control Panel - Accessibility Options - Mouse" option window Command line: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5 Function: Display the "Control Panel - Accessibility Options - Legacy" option window Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1 Function: Execute the "Control Panel - Add New Hardware" wizard. Command line: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter Function: Execute the "Control Panel - Add New Printer" wizard. Command line: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1 Function: Display the "Control Panel - Add/Remove Programs - Install/Uninstall" panel. Command line: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2 Function: Display the "Control Panel - Add/Remove Programs - Install Windows" panel. Command line: rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3 Function: Display the "Control Panel - Add/Remove Programs - Startup Disk" panel. Command line: rundll32.exe syncui.dll,Briefcase_Create Function: Create a new "My Briefcase" on the desktop. Command line: rundll32.exe diskcopy.dll,DiskCopyRunDll Function: Display the disk copying window Command line: rundll32.exe apwiz.cpl,NewLinkHere %1 Function: Display the "Create Shortcut" dialog box, and the location of the created shortcut is determined by the %1 parameter. Command line: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0 Function: Display the "Date and Time" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1 Function: Display the "Time Zone" option window. Command line: rundll32.exe rnaui.dll,RnaDial [name of a certain dial-up connection] Function: Display the dial-up window of a certain dial-up connection. If a dial-up connection has been made, display the window of the current connection status. Command line: rundll32.exe rnaui.dll,RnaWizard Function: Display the window of the "New Dial-up Connection" wizard. Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0 Function: Display the "Display Properties - Background" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1 Function: Display the "Display Properties - Screen Saver" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2 Function: Display the "Display Properties - Appearance" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3 Function: Display the "Display Properties - Properties" option window. Command line: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL FontsFolder Function: Display the "Fonts" folder of Windows. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3 Function: Also display the "Fonts" folder of Windows. Command line: rundll32.exe shell32.dll,SHformatDrive Function: Display the format disk dialog box. Command line: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,0 Function: Display the "Control Panel - Game Controllers - General" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL joy.cpl,,1 Function: Display the "Control Panel - Game Controllers - Advanced" option window. Command line: rundll32.exe mshtml.dll,PrintHTML (HTML document) Function: Print the HTML document. Command line: rundll32.exe shell32.dll,Control_RunDLL mlcfg32.cpl Function: Display the Microsoft Exchange general options window. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @0 Function: Display the "Control Panel - Mouse" option. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1 Function: Display the "Control Panel - Keyboard Properties - Speed" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,1 Function: Display the "Control Panel - Keyboard Properties - Language" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @2 Function: Display the Windows "Printers" folder. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @3 Function: Display the Windows "Fonts" folder. Command line: rundll32.exe shell32.dll,Control_RunDLL main.cpl @4 Function: Display the "Control Panel - Input Method Properties - Input Method" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL modem.cpl,,add Function: Execute the "Add New Modem" wizard. Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0 Function: Display the "Control Panel - Multimedia Properties - Audio" property page. Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1 Function: Display the "Control Panel - Multimedia Properties - Video" property page. Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,2 Function: Display the "Control Panel - Multimedia Properties - MIDI" property page. Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,3 Function: Display the "Control Panel - Multimedia Properties - CD Music" property page. Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4 Function: Display the "Control Panel - Multimedia Properties - Devices" property page. Command line: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1 Function: Display the "Control Panel - Sound" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl Function: Display the "Control Panel - Network" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL odbccp32.cpl Function: Display the ODBC32 Data Source Administrator option window. Command line: rundll32.exe shell32.dll,OpenAs_RunDLL{drive:\path\filename} Function: Display the "Open With" dialog box for the specified file (drive:\path\filename). Command line: rundll32.exe shell32.dll,Control_RunDLL password.cpl Function: Display the "Control Panel - Password" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl Function: Display the "Control Panel - Power Management Properties" option window. Command line: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder Function: Display the Windows "Printers" folder. (Same as rundll32.exe shell32.dll,Control_RunDLL main.cpl @2) Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0 Function: Display the "Control Panel - Regional Options Properties - Regional Settings" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1 Function: Display the "Control Panel - Regional Options Properties - Numbers" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,2 Function: Display the "Control Panel - Regional Options Properties - Currency" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3 Function: Display the "Control Panel - Regional Options Properties - Time" option window. Command line: rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,4 Function: Display the "Control Panel - Regional Options Properties - Date" option window. Command line: rundll32.exe desk.cpl,InstallScreenSaver [screen saver file name] Function: Set the specified screen saver file as the Windows screen saver and display the screen saver properties window. Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0 Function: Display the "Control Panel - System Properties - Legacy" property window. Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1 Function: Display the "Control Panel - System Properties - Device Manager" property window. Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2 Function: Display the "Control Panel - System Properties - Hardware Profiles" property window. Command line: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3 Function: Display the "Control Panel - System Properties - Performance" property window. Command line: rundll32.exe user.exe,restartwindows Function: Forcefully close all programs and restart the computer. Command line: rundll32.exe user.exe,exitwindows Function: Forcefully close all programs and shut down the computer. Command line: rundll32.exe shell32.dll,Control_RunDLL telephon.cpl Function: Display the "Dial-up Properties" option window Command line: rundll32.exe shell32.dll,Control_RunDLL themes.cpl Function: Display the "Desktop Themes" option panel Of course, not only Visual Basic, but also other programming languages such as Delphi, Visual C++ can use these functions of Rundll by calling external commands. The specific methods will not be described in detail here. Flexibly using Rundll will definitely make your programming easy and achieve twice the result with half the effort! The above content is taken from "Programming Technology" |
|
| Floor7 Climbing | Posted 2005-08-31 10:30 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
Okay, it's getting more and more interesting.
|
|
| Floor8 lhy1836 | Posted 2005-08-31 16:29 |
| 初级用户 Posts 11 Credits 22 | |
|
It's indeed getting more and more interesting. It seems there are several methods to shut down while it's running. But mainly it's rundll32.exe. What I don't understand is why in the reboot, the master on the 2nd floor used rundll.exe while for shutdown it's rundll.exe. What's the difference between these two?
|
|
| Floor9 Climbing | Posted 2005-08-31 17:49 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
The reason has been explained on the 6th floor. It should be that different APIs are called.
|
|
| Floor10 JonePeng | Posted 2005-08-31 20:50 |
| 金牌会员 Posts 1,883 Credits 4,562 From 广东广州 | |
|
Actually, both shutting down and restarting in Win98 can use RUNDLL.
|
|
| Floor11 lhy1836 | Posted 2005-08-31 21:27 |
| 初级用户 Posts 11 Credits 22 | |
|
I wonder if you've tried it. The restart using "RUNDLL.EXE user.exe,exitwindowsexec" is different from the restart using "Rundll32.exe Shell32.dll,SHExitWindowsEx 2". You can give it a try if you don't believe it.
|
|
| Floor12 JonePeng | Posted 2005-08-31 23:05 |
| 金牌会员 Posts 1,883 Credits 4,562 From 广东广州 | |
|
The former is "quick boot", that is, without going through the BIOS post, Win98 exits the GUI, jumps to pure DOS and then reloads the GUI. The latter is the normal warm boot.
|
|
| Floor13 hxj | Posted 2005-09-01 19:34 |
| 中级用户 Posts 66 Credits 377 | |
|
I also say something:
The above command to restart Win98 may only be suitable for machines with a separate Win98 installation. I tried using RUNDLL.EXE user.exe,exitwindowsexec and Rundll32.exe Shell32.dll,SHExitWindowsEx 2 from the Win98 in the dual system of WinXP and Win98, but neither could achieve restarting. Since there is no machine with a single Win98 installation to test, the above inference may not be correct. In short, in order to solve the problem of restarting Win98 in the dual system in batch processing, I have searched the Internet all over and also asked experts, but I still haven't solved the problem so far! |
|
| Floor14 JonePeng | Posted 2005-09-01 22:13 |
| 金牌会员 Posts 1,883 Credits 4,562 From 广东广州 | |
Originally posted by hxj at 2005-9-1 19:34: My machine is a dual system of Win98 + WinXP. I just verified it, both can restart. It is not only suitable for machines with a single system. The first command above is a quick restart that skips the self-check, and the second is a normal warm restart. |
|
| Floor15 lhy1836 | Posted 2005-09-01 23:12 |
| 初级用户 Posts 11 Credits 22 | |
|
It seems that the comrade in the 13th floor made a typo in the command or there is something wrong with your system.
|
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |