1. Creating directories and restarting a computer

------=_NextPart_000_0007_01C0A67F.BDB22500
	charset="iso-8859-1"

Hi!!

I have two questions. How can I restart a computer using Euphoria. I =
have a program I wrote and I need to restart a computer before the =
settings activate. Is there a command or system routine.

Secondly how do you create new directories.

Thanks

Martin

------=_NextPart_000_0007_01C0A67F.BDB22500
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have two questions. How can I restart =
a computer=20
using Euphoria. I have a program I wrote and I need to restart a =
computer before=20
the settings activate. Is there a command or system =
routine.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Secondly how do you create new=20
directories.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Martin</FONT></DIV>
------=_NextPart_000_0007_01C0A67F.BDB22500--

new topic     » topic index » view message » categorize

2. Re: Creating directories and restarting a computer

To create a directory:
system("mkdir " & dir_name,2)

To restart in Linux:
system("halt",2)
--User must have permission to "halt"

I'm not sure how to do it in windows... Since I always
restart using the GUI.



--- tuncaydin6 at tuncaydin6.screaming.net wrote:
> Hi!!
> 
> I have two questions. How can I restart a computer
> using Euphoria. I have a program I wrote and I need
> to restart a computer before the settings activate.
> Is there a command or system routine.
> 
> Secondly how do you create new directories.
> 
> Thanks
> 
> Martin

new topic     » goto parent     » topic index » view message » categorize

3. Re: Creating directories and restarting a computer

Here's some (untested) code to shutdown, logoff, or restart in windows:

include dll.e
constant USER32 = open_dll("user32")
constant SHUTDOWNEX = define_c_func(USER32, "ExitWindowsEx", {C_UINT,
C_LONG}, C_INT)
global constant EWX_FORCE = 4, -- Force processes to terminate, don't send
          -- WM_QUERYENDSESSION or WM_ENDSESSION
          -- only use in an emergency
  EWX_LOGOFF = 0,
  EWX_POWEROFF = 8,
  EWX_REBOOT = 2,
  EWX_SHUTDOWN = 1
global procedure win32_shutdown(integer shutdown_type)
    integer x
    x = c_func(SHUTDOWNEX, {shutdown_type, 0})
end procedure

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu