Function Shutdown

  • Shuts down or restarts the system based on the specified flags.

    Parameters

    • flags: ShutdownFlag

      The shutdown flags to control the behavior (e.g., Shutdown, Reboot, Hibernate).

    Returns number

    1 if successful, 0 otherwise.

    import { Shutdown, ShutdownFlag } from '@ahmic/autoit-js';

    Shutdown(ShutdownFlag.Reboot);

    // Use bitwise OR to combine flags
    Shutdown(ShutdownFlag.Shutdown | ShutdownFlag.Force);