sys.halt([mode])function

Shutdown the operating system.

Parameters

[mode]

An optional string that indicates the shutdown method to use. If this parameter is not specified, the default value "shutdown" is used.

  • "logoff" : close the current Windows session
  • "shutdown" : shutdown the computer
  • "reboot" : reboot the computer

Return value

This function returns no value.

Example

--! luart-extensions import console print('Do you want to close the current session ? (y/n)') local answer = string.upper(console.read(1)) if answer == 'Y' then sys.halt("logoff") end