China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-29 05:06
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » How to restart the computer by entering a command in Start - Run View 2,302 Replies 16
Original Poster Posted 2005-08-30 21:22 ·  中国 福建 福州 平潭县 电信
初级用户
Credits 22
Posts 11
Joined 2005-08-28 19:45
20-year member
UID 42037
Status Offline
How to use the method of entering a command in Start - Run in WIN98 to make the computer restart by itself.
Floor 2 Posted 2005-08-30 21:54 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
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!
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 3 Posted 2005-08-30 21:59 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
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.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 4 Posted 2005-08-30 22:25 ·  中国 福建 福州 电信
初级用户
Credits 22
Posts 11
Joined 2005-08-28 19:45
20-year member
UID 42037
Status Offline
Thank you, two masters. Then if I want to put these commands in a batch file, how should I handle it?
Floor 5 Posted 2005-08-30 23:01 ·  中国 福建 福州 电信
初级用户
Credits 22
Posts 11
Joined 2005-08-28 19:45
20-year member
UID 42037
Status Offline
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.
Floor 6 Posted 2005-08-31 09:24 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
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"
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 7 Posted 2005-08-31 10:30 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Okay, it's getting more and more interesting.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 8 Posted 2005-08-31 16:29 ·  中国 福建 福州 电信
初级用户
Credits 22
Posts 11
Joined 2005-08-28 19:45
20-year member
UID 42037
Status Offline
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?
Floor 9 Posted 2005-08-31 17:49 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
The reason has been explained on the 6th floor. It should be that different APIs are called.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 10 Posted 2005-08-31 20:50 ·  中国 广东 广州 白云区 电信
金牌会员
★★★★
D◎$ Fαп
Credits 4,562
Posts 1,883
Joined 2004-01-19 00:00
22-year member
UID 15812
Gender Male
From 广东广州
Status Offline
Actually, both shutting down and restarting in Win98 can use RUNDLL.
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Floor 11 Posted 2005-08-31 21:27 ·  中国 福建 福州 电信
初级用户
Credits 22
Posts 11
Joined 2005-08-28 19:45
20-year member
UID 42037
Status Offline
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.
Floor 12 Posted 2005-08-31 23:05 ·  中国 广东 广州 白云区 电信
金牌会员
★★★★
D◎$ Fαп
Credits 4,562
Posts 1,883
Joined 2004-01-19 00:00
22-year member
UID 15812
Gender Male
From 广东广州
Status Offline
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.
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Floor 13 Posted 2005-09-01 19:34 ·  中国 上海 东方有线
中级用户
★★
Credits 377
Posts 66
Joined 2005-04-04 00:00
21-year member
UID 37817
Gender Male
Status Offline
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!
Floor 14 Posted 2005-09-01 22:13 ·  中国 广东 广州 白云区 电信
金牌会员
★★★★
D◎$ Fαп
Credits 4,562
Posts 1,883
Joined 2004-01-19 00:00
22-year member
UID 15812
Gender Male
From 广东广州
Status Offline
Originally posted by hxj at 2005-9-1 19:34:
Using RUNDLL.EXE user.exe,exitwindowsexec
Rundll32.exe Shell32.dll,SHExitWindowsEx 2
Neither of them can achieve restart. Since there is no machine with only Win98 installed to test, the above inference may not be correct.


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.
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Floor 15 Posted 2005-09-01 23:12 ·  中国 福建 福州 电信
初级用户
Credits 22
Posts 11
Joined 2005-08-28 19:45
20-year member
UID 42037
Status Offline
It seems that the comrade in the 13th floor made a typo in the command or there is something wrong with your system.
Forum Jump: