Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Shutdown

Status
Not open for further replies.

candrid

IS-IT--Management
Aug 30, 2001
38
US
How can I make my windows 98 system shut down at a certain time? Example 8pm?

Is there some software or something?

Thanks for all your help.

-candrid. --"Hello Microsoft? Yeah this is Mike again.. now it says: "Hit any key when ready..." My question is: "Where's the "any key"? Is my keyboard broken..?
 
I'm not sure if this will work. However, this may produce unexpected results if the system is being used at the time the shutdown sequence is activated.


Create a batch file that contains:
Rundll32.exe User32.exe,ExitWindows

Run Task Scheduler and activate the .bat you created for the time you want.


Also, I am not even certain that this will close the windows that are logged onto a server. Most likely, this will function on the client side, but again, I'm not sure. Let me know if it does or not. It will be interesting to find out. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
It dosent seem to work under the task scheduler --"Hello Microsoft? Yeah this is Mike again.. now it says: "Hit any key when ready..." My question is: "Where's the "any key"? Is my keyboard broken..?
 
candrid

Try batch file and scheduler as MiggyD suggested but instead of:

Rundll32.exe User32.exe,ExitWindows in batch file

substitute

RunDll32.exe Shell32.dll,SHExitWindowsEx 0x01

courtesy Gunter Born

Works fine on WinMe and is backdoor shutdown for Win98 smitee
 
Sorry, I forgot this is Win9x.

Try Rundll.exe User.exe,ExitWindows

[note--remove the 32's from the originally posted one]
[thanks smitee for the clairification.] --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
Hi MiggyD

Both work...I seem to have connect problem when I reboot after using "Rundll.exe User.exe,ExitWindows" to shutdown.
Same problem after visit to "minimal startup" when cache cleaning. etc. Have to reboot and shutdown with Start menu or use rundll32 command as below to ensure cable modem inialize on restart??
.
If I use "Gunter's" command "RunDll32.exe Shell32.dll,SHExitWindowsEx 0x01" reboot seems okay.
Am on WinME anyways so really not too sure what's up. Passing 0x02 above gives "restart" and 0x00 gives "logOff"..

PS...agree with Deltree but Del works fine as posted by MKB...re: Recycled Post

Regards smitee
 
smitee:

Odd thing about that DEL/Tree thing. Just looked in an old VB prog I had to answer the shutdown passing values see the bold section below:

'-----------------
Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long

Private Const EWX_SHUTDOWN As Long = 1
Private Const EWX_REBOOT As Long = 2
Private Const EWX_LOGOFF As Long = 0


Sub ShutDownWindows()
ShutDown = ExitWindowsEx(EWX_SHUTDOWN, 0&)
End Sub

Sub RestartWindows()
Restart = ExitWindowsEx(EWX_REBOOT, 0&)
End Sub

Sub LogOFFWindows()
LogOff = ExitWindowsEx(EWX_LOGOFF, 0&)
End Sub
'-----------------

As you can see the values are CONSTs in window's dll files. Hope this clears it up. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top