1. restarting Windows from Eu
- Posted by Brian Jackson <bjackson at 2FARGON.COM> Feb 29, 2000
- 501 views
Hi all, I've been trying to figure out how to force windows to restart from a Euphoria program. I know that the command to do so is: rundll32.exe shell32.dll,SHExitWindowsEx 2 However, I can't get it to work using shellExecute() in win32lib (absolutely nothinhg happens), and if I try to use system_exec() then it refuses because it is running in a console window, and wants that to be closed before Windows will restart. Any suggestions? Brian
2. Re: restarting Windows from Eu
- Posted by A Batista <Albert.Batista at BMGDIRECT.COM> Feb 29, 2000
- 494 views
Actually, my first Euphoria program involved restarting windows. It was able to reboot using two different times of the day. I'll paste snippits of the lines I needed to get it done. atom User32, Reboot_code, Dummy_code integer zRebooter Reboot_code = 2 Dummy_code = 0 User32 = open_dll("user32.dll") zRebooter = linkProc(User32, "ExitWindowsEx", {C_LONG, C_LONG}) c_proc(zRebooter, {Reboot_code, Dummy_code}) That should be it. If someone else knows a better way, please tell! =) Btw, it will not reboot a windows NT machine since it involves setting a priviledge I haven't the foggiest about implementing yet. -----Original Message----- From: Brian Jackson [mailto:bjackson at 2FARGON.COM] Sent: Tuesday, February 29, 2000 9:29 AM To: EUPHORIA at LISTSERV.MUOHIO.EDU Subject: restarting Windows from Eu Hi all, I've been trying to figure out how to force windows to restart from a Euphoria program. I know that the command to do so is: rundll32.exe shell32.dll,SHExitWindowsEx 2 However, I can't get it to work using shellExecute() in win32lib (absolutely nothinhg happens), and if I try to use system_exec() then it refuses because it is running in a console window, and wants that to be closed before Windows will restart. Any suggestions? Brian
3. Re: restarting Windows from Eu
- Posted by Brian Jackson <bjackson at 2FARGON.COM> Feb 29, 2000
- 496 views
On Tue, 29 Feb 2000 11:35:39 -0500, A Batista <Albert.Batista at BMGDIRECT.COM> wrote: Excellent. Works like a charm on Win9x. Also, ExitWindowsEx is actually a function. Try changing the code to this: atom User32, Reboot_code, Dummy_code integer zRebooter Reboot_code = 2 Dummy_code = 0 User32 = open_dll("user32.dll") zRebooter = linkFunc(User32, "ExitWindowsEx", {C_LONG, C_LONG},C_LONG) if not c_proc(zRebooter, {Reboot_code, Dummy_code}) then puts(1,"REBOOT FAILED!) end if >Actually, my first Euphoria program involved restarting windows. It was >able to reboot >using two different times of the day. I'll paste snippits of the lines I >needed to get >it done. > >atom User32, Reboot_code, Dummy_code >integer zRebooter > > Reboot_code = 2 > Dummy_code = 0 > User32 = open_dll("user32.dll") > zRebooter = linkProc(User32, "ExitWindowsEx", {C_LONG, C_LONG}) > c_proc(zRebooter, {Reboot_code, Dummy_code}) > >That should be it. If someone else knows a better way, please tell! =) >Btw, it will not reboot a windows NT machine since it involves setting a >priviledge I >haven't the foggiest about implementing yet. > > > >-----Original Message----- >From: Brian Jackson [mailto:bjackson at 2FARGON.COM] >Sent: Tuesday, February 29, 2000 9:29 AM >To: EUPHORIA at LISTSERV.MUOHIO.EDU >Subject: restarting Windows from Eu > > >Hi all, > >I've been trying to figure out how to force windows to restart from a >Euphoria program. I know that the command to do so is: > >rundll32.exe shell32.dll,SHExitWindowsEx 2 > >However, I can't get it to work using shellExecute() in win32lib >(absolutely nothinhg happens), and if I try to use system_exec() then it >refuses because it is running in a console window, and wants that to be >closed before Windows will restart. Any suggestions? > >Brian