Solved

i need a .bat file that exits win98

Posted on 2000-02-23
7
319 Views
Last Modified: 2013-12-28
i need a .bat file that exits win98,
i mean i need a .bat file that could exit and shut down my win98 session, without makeing no clicks! some friend told me to edit and run something like:                
                @exit
but, i did not work please help! my email is desconsiderao@hotmail.com
0
Comment
Question by:alonsolezama
7 Comments
 
LVL 20

Expert Comment

by:hes
ID: 2553094
You can't do that in a .bat file
The @exit only leaves the batch file you are in.
Ther only way to do that is to have a program in your batch file that shutsdown windows.
0
 

Expert Comment

by:zbrusko
ID: 2553108
this probably isn't much of a help, but if you run something like "rundll32.exe /shutdown" or something like this, I believe that will do the trick.  I am not sure exactly what the parameter is though.
0
 

Expert Comment

by:zbrusko
ID: 2553117
Actually, that isn't how you do it, but I do think that it is possible, sorry I couldn't help.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Expert Comment

by:wjakubec
ID: 2553171
Put The EXIT command at the end of the Bat file and the save the file.  Right Click on the file and select properties and click on the program tab.  Check the box that says Close on Exit.  It will close after running the bat file.

Good Luck
0
 
LVL 1

Expert Comment

by:gsoldado
ID: 2553178
Using a text editor (such as Notepad), type the following by itself:
@EXIT
Save the file somewhere on your hard disk - call it whatever you like, as long as it has the extension .bat.
Make a shortcut to the batch file, and place it on your desktop (or wherever you want).
Right-click on the shortcut, select Properties, click the Program tab, and make sure the Close on Exit option is turned on.
Then, click Advanced, and make sure MS-DOS mode is selected, and Warn before entering MS-DOS mode is turned off.
Click Ok twice, and double-click on the icon to use it.
0
 
LVL 25

Accepted Solution

by:
dew_associates earned 50 total points
ID: 2553281
gsoldado, did you read what alonsolezama posted, he tried that and it didn't work. By the way, we do observe a protocol on this site as to how and when to post answers, one of which is not to block questions with answers that are speculative as an example. Also, questioners can accept comments as answers, so in situations such as this, it would have been prudent to do that until the questioner found something that worked.

Alonsolezama, here are the various parameters you can use with Windows 98 or 98SE:

You can use either of the following commands in a batch file to restart Windows 98 automatically:
 
runonce.exe -q
 
rundll32.exe shell32.dll,SHExitWindowsEx n
 
Where n is one, or a combination of, the following numbers:
 
0 - LOGOFF
1 - SHUTDOWN
2 - REBOOT
4 - FORCE
8 - POWEROFF
 
All of the above options can be combined into one value to achieve different results. For example, to restart Windows forcefully, without querying any running programs, use the following command line:
 
rundll32.exe shell32.dll,SHExitWindowsEx 6
 
Be careful, using the FORCE option can cause programs to lose data.
 
The following is an explanation of each available option used with the above command line:
 
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.
 
The "rundll32.exe shell32.dll,SHExitWindowsEx (n)" command mentioned above can also be called from the RunOnce registry key.
 
The runonce.exe -q command restarts the computer after a 15 second delay. There are no other options when using this command line, and it cannot be called from the RunOnce registry key.

If you need more, let me know!

Dennis
0
 

Author Comment

by:alonsolezama
ID: 2580865
sorry but it did not work!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now