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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restarting Windows 98

Status
Not open for further replies.

SLS

Programmer
Dec 12, 2001
14
BB
I Have Writen a Progran Using VB5 That Can Call External Programs on a Pre-Defined Schedual During The Night...

I Would Like To Be Able To Have a Windows 98 System Restarted...

I Have Searched the Tek ... and All Results Do Not Seem to Work...

I Search the Internet and Found This...

If I Select the Windows Run Option and Type...
rundll.exe User.exe,exitwindowsexec

Windows Restarts Nice...

If I Put The Same Command Line Into a Bat File... I Get a Message... File Not Found...
(Same Thing If I Use The Shell Function in VB5)

Can AnyBody Give Mey The Correct VB5 Code Line For Windows Restart... or a Correct Bat File Example That Works

Thanks
 
If you get file not found then maybe the files are not in your path... search the machine for the files and either add their parent folders to your path or call them with the full path name.

You can also call the Win32 API function ExitWindowsEx and pass it the reboot parameter.
 
I Did That....rundll.exe is in the Windows Dir.... and User.exe is in the Windows\System Dir

 
Did you try executing it using the full paths?

Anyway, if you cant get it to work this way you can always call the API.. that will work all the way back to Win95.
 
Did you try using the ExitWindowsEx API:

Declares:
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Const EWX_REBOOT = 2
Private Const EWX_FORCE = 4


Usage:
ExitWindowsEx EWX_FORCE Or EWX_REBOOT, 0



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
DrJavaJoe...

Works Fine Now

Thankyou...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top